50 lines
1.3 KiB
C#
50 lines
1.3 KiB
C#
// Copyright © Gamesmiths Guild.
|
|
|
|
#if TOOLS
|
|
using System;
|
|
using Gamesmiths.Forge.Godot.Editor.Statescript.Resolvers.Bases;
|
|
using Gamesmiths.Forge.Godot.Resources.Statescript.Resolvers;
|
|
using Godot;
|
|
using ForgeVariant128 = Gamesmiths.Forge.Statescript.Variant128;
|
|
using SysVector2 = System.Numerics.Vector2;
|
|
using SysVector3 = System.Numerics.Vector3;
|
|
using SysVector4 = System.Numerics.Vector4;
|
|
|
|
namespace Gamesmiths.Forge.Godot.Editor.Statescript.Resolvers;
|
|
|
|
[Tool]
|
|
internal sealed partial class NegateResolverEditor
|
|
: NumericOrVectorUnaryResolverEditorBase<NegatePassthroughResolverResource>
|
|
{
|
|
public override string DisplayName => "Negate";
|
|
|
|
public override string ResolverTypeId => "Negate";
|
|
|
|
public override bool IsCompatibleWith(Type expectedType)
|
|
{
|
|
return expectedType == typeof(ForgeVariant128)
|
|
|| ResolverEditorCompatibility.IsNumericVectorOrQuaternionType(expectedType);
|
|
}
|
|
|
|
protected override Type[] GetFactoryExpectedTypes(Type expectedType)
|
|
{
|
|
return expectedType == typeof(ForgeVariant128)
|
|
? [
|
|
typeof(int),
|
|
typeof(float),
|
|
typeof(double),
|
|
typeof(SysVector2),
|
|
typeof(SysVector3),
|
|
typeof(SysVector4),
|
|
typeof(System.Numerics.Quaternion)
|
|
]
|
|
: [expectedType];
|
|
}
|
|
|
|
protected override Type GetNestedExpectedType(Type expectedType)
|
|
{
|
|
return expectedType;
|
|
}
|
|
}
|
|
#endif
|