示例#1
0
        /// <summary>
        /// Makes the player respawn at the location passed in parameters
        /// </summary>
        /// <param name="spawnPoint">The location of the respawn.</param>
        public virtual void RespawnAt(Transform spawnPoint, FacingDirections facingDirection)
        {
            if (!gameObject.activeInHierarchy)
            {
                //Debug.LogError("Spawn : your Character's gameobject is inactive");
                return;
            }

            // we make sure the character is facing right
            Face(facingDirection);

            // we raise it from the dead (if it was dead)
            ConditionState.ChangeState(CharacterStates.CharacterConditions.Normal);
            // we re-enable its 2D collider
            GetComponent <Collider2D>().enabled = true;
            // we make it handle collisions again
            _controller.CollisionsOn();
            transform.position = spawnPoint.position;
            if (_health != null)
            {
                _health.ResetHealthToMaxHealth();
                _health.Revive();
            }
        }
示例#2
0
 protected void RestoreBossHealth()
 {
     BossHealth.ResetHealthToMaxHealth();
 }