Exemple #1
0
        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();
            }
        }
Exemple #2
0
 private void DeactivateSoul()
 {
     if (_activatingSoul)
     {
         ActiveSoul.Deactivated();
         _activatingSoul = false;
     }
 }
Exemple #3
0
 private void ActivateSoul()
 {
     if (!_activatingSoul)
     {
         ActiveSoul.Activated();
         _activatingSoul = true;
     }
 }
Exemple #4
0
        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;
        }