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(); } }
private void DeactivateSoul() { if (_activatingSoul) { ActiveSoul.Deactivated(); _activatingSoul = false; } }
private void ActivateSoul() { if (!_activatingSoul) { ActiveSoul.Activated(); _activatingSoul = true; } }
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; }