/// <summary> /// Disables the falling platform. We're not destroying it, so we can revive it on respawn /// </summary> protected virtual void DisableFallingPlatform() { if (_autoRespawn == null) { this.gameObject.SetActive(false); } else { _autoRespawn.Kill(); } this.transform.position = _initialPosition; _timer = TimeBeforeFall; _shaking = false; }
/// <summary> /// Destroys the object, or tries to, depending on the character's settings /// </summary> protected virtual void DestroyObject() { if (!DestroyOnDeath) { return; } if (_autoRespawn == null) { // object is turned inactive to be able to reinstate it at respawn gameObject.SetActive(false); } else { _autoRespawn.Kill(); } }