public override void _Ready() { _owner = Owner as Node2D; _velocityComponent = GetNodeOrNull <VelocityComponent>(_velocityComponentPath ?? string.Empty); _entityAnimationComponent = GetNodeOrNull <EntityAnimationComponent>(_entityAnimationComponentPath ?? string.Empty); GetNodeOrNull <HealthComponent>(_healthComponentPath ?? string.Empty)?.Connect(nameof(HealthComponent.HealthDepleted), this, nameof(OnHealthDepleted)); }
public override void _Ready() { _stateMachine.AddState(MoveState.GROUNDED, StateGrounded); _stateMachine.AddState(MoveState.AIRBORNE, StateAirborne); _stateMachine.SetInitialState(MoveState.GROUNDED); _owner = Owner as KinematicBody2D; _velocityComponent = GetNode <VelocityComponent>(_velocityComponentPath); _entityAnimationComponent = GetNode <EntityAnimationComponent>(_entityAnimationComponentPath); _weaponSocketComponent = GetNode <WeaponSocketComponent>(_weaponSocketComponentPath); GetNode <Timer>("Timer").Connect("timeout", this, nameof(OnTimerTimeout)); }