You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
987 B

namespace CMSGame
{
public partial class BattleCharacter : CharacterBody3D
{
[Signal]
public delegate void MousePressedEventHandler(Vector3 position);
[Export]
public Texture SpriteTexture;
public BattleFieldPosition BattleFieldPosition;
public Character Character;
public Sprite3D Sprite3D;
public Label3D StatusLabel;
public override void _Ready()
{
this.GetUniqueNode(ref Sprite3D, nameof(Sprite3D));
this.GetUniqueNode(ref StatusLabel, nameof(StatusLabel));
}
public override void _InputEvent(Camera3D camera, InputEvent @event, Vector3 position, Vector3 normal, int shapeIdx)
{
if (@event is InputEventMouseButton mouseButtonEvent)
{
if (mouseButtonEvent.Pressed)
{
EmitSignal(SignalName.MousePressed, position);
}
}
}
}
}