コード例 #1
0
ファイル: PlayerController.cs プロジェクト: bbuck/reaper
        private void HandleActiveSoul()
        {
            if (ActiveSoul == null)
            {
                return;
            }

            if (Input.GetButtonDown("ActivateSoul"))
            {
                if (ActiveSoul.ShouldActivate())
                {
                    ActivateSoul();
                }
            }

            if (_activatingSoul)
            {
                if (ActiveSoul.ShouldDeactivate())
                {
                    DeactivateSoul();
                }
                else
                {
                    ActiveSoul.Update();
                }
            }

            if (Input.GetButtonUp("ActivateSoul"))
            {
                DeactivateSoul();
            }
        }
コード例 #2
0
ファイル: PlayerController.cs プロジェクト: bbuck/reaper
 private void DeactivateSoul()
 {
     if (_activatingSoul)
     {
         ActiveSoul.Deactivated();
         _activatingSoul = false;
     }
 }
コード例 #3
0
ファイル: PlayerController.cs プロジェクト: bbuck/reaper
 private void ActivateSoul()
 {
     if (!_activatingSoul)
     {
         ActiveSoul.Activated();
         _activatingSoul = true;
     }
 }
コード例 #4
0
ファイル: PlayerController.cs プロジェクト: bbuck/reaper
        private void Awake()
        {
            if (Instance != null && Instance != this)
            {
                Debug.LogError("There appear to be more than one player objects in this scene, this is an error state.");
            }

            Instance = this;

            Motor = GetComponent <PhysicsMotor2D>();

            if (debugSoul != null)
            {
                ActiveSoul = debugSoul;
                ActiveSoul.Initialize(this);
            }

            _activatingSoul = false;
        }