Merge remote-tracking branch 'origin/master' into 1.7

This commit is contained in:
Wojtek Figat
2023-08-01 14:05:49 +02:00
25 changed files with 646 additions and 136 deletions

View File

@@ -53,4 +53,23 @@ namespace FlaxEngine
UseSmallPicker = useSmallPicker;
}
}
#if USE_NETCORE
/// <summary>
/// Specifies a options for an asset reference picker in the editor. Allows to customize view or provide custom value assign policy.
/// </summary>
/// <seealso cref="System.Attribute" />
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)]
public class AssetReferenceAttribute<T> : AssetReferenceAttribute
{
/// <summary>
/// Initializes a new instance of the <see cref="AssetReferenceAttribute"/> class for generic type T.
/// </summary>
/// <param name="useSmallPicker">True if use asset picker with a smaller height (single line), otherwise will use with full icon.</param>
public AssetReferenceAttribute(bool useSmallPicker = false)
: base(typeof(T), useSmallPicker)
{
}
}
#endif
}

View File

@@ -17,10 +17,29 @@ public class Scripting : EngineModule
{
if (EngineConfiguration.WithDotNet(options))
{
void AddFrameworkDefines(string template, int major, int latestMinor)
{
for (int minor = latestMinor; minor >= 0; minor--)
{
options.ScriptingAPI.Defines.Add(string.Format(template, major, minor));
options.ScriptingAPI.Defines.Add(string.Format($"{template}_OR_GREATER", major, minor));
}
}
// .NET
options.PrivateDependencies.Add("nethost");
options.ScriptingAPI.Defines.Add("USE_NETCORE");
// .NET SDK
AddFrameworkDefines("NET{0}_{1}", 7, 0); // "NET7_0" and "NET7_0_OR_GREATER"
AddFrameworkDefines("NET{0}_{1}", 6, 0);
AddFrameworkDefines("NET{0}_{1}", 5, 0);
options.ScriptingAPI.Defines.Add("NET");
AddFrameworkDefines("NETCOREAPP{0}_{1}", 3, 1); // "NETCOREAPP3_1" and "NETCOREAPP3_1_OR_GREATER"
AddFrameworkDefines("NETCOREAPP{0}_{1}", 2, 2);
AddFrameworkDefines("NETCOREAPP{0}_{1}", 1, 1);
options.ScriptingAPI.Defines.Add("NETCOREAPP");
if (options.Target is EngineTarget engineTarget && engineTarget.UseSeparateMainExecutable(options))
{
// Build target doesn't support linking again main executable (eg. Linux) thus additional shared library is used for the engine (eg. libFlaxEditor.so)