DungeonRPG/Scripts/Characters/PlayerState3D.cs

36 lines
798 B
C#

using DungeonRPG.Scripts.General;
using Godot;
public partial class PlayerState3D : Node
{
protected Player3D characterNode;
public override void _Ready()
{
characterNode = GetOwner<Player3D>();
SetPhysicsProcess(false);
SetProcessInput(false);
}
public override void _Notification(int what)
{
base._Notification(what);
if (what == GameConstants.STATE_NOTIFICATION_ENABLE)
{
SetPhysicsProcess(true);
SetProcessInput(true);
EnterState();
}
else if (what == GameConstants.STATE_NOTIFICATION_DISABLE)
{
SetPhysicsProcess(false);
SetProcessInput(false);
}
}
protected virtual void EnterState()
{ }
}