/// <summary> /// 玩家复活 /// </summary> /// <param name="point"></param> public void Revive(Transform point) { if (!m_IsAlive && IsFallToGround) { Teleport(point.position); transform.rotation = point.rotation; transform.localScale = point.localScale; m_Damageable.Revive(); m_Animator.SetBool("IsDeath", false); m_IsAlive = true; controlEnabled = true; } }
/// <summary> /// 敌人复活,注意复活后会被直接回收 /// </summary> /// <param name="point">复活点</param> public void Revive(Transform point) { if (!m_IsAlive && IsGrounded) { Teleport(point.position); transform.rotation = point.rotation; transform.localScale = point.localScale; m_Damageable.Revive(); m_Rigidbody2D.WakeUp(); m_SpriteRenderer.sortingOrder = m_SortingOrder; m_Animator.SetBool("IsDeath", false); m_Collider2d.isTrigger = false; m_Collider2d.enabled = true; controlEnabled = true; m_IsAlive = true; enabled = true; ObjPoolMgr.Instance.RecycleObj(gameObject); } }