コード例 #1
0
        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));
        }
コード例 #2
0
 public override void _Ready()
 {
     _weaponSocketComponent = GetNode <WeaponSocketComponent>(_weaponSocketComponentPath);
     _aiBehaviorComponent   = GetNode <AIBehaviorComponent>(_aiBehaviorComponentPath);
     _hands = GetNodeOrNull <Hands>(_handsPath ?? string.Empty);
 }