public void Restart() { // When the game starts the character should be able to move and the collider should be on but the player is not dead. m_AiCharacter.enabled = true; m_Collider.enabled = true; m_IsDying = false; // Move the character back to the start position. m_Agent.Warp(m_OriginPosition); // Make sure the character is already at the position that is trying to be reached. m_AiCharacter.SetTarget(transform.position); // Reset the animator. m_Animator.SetTrigger(m_HashResetPara); // The game is not over. m_IsGameOver = false; }
private void HandleSetTarget(Transform target) { // If the game isn't over set the destination of the AI controlling the character and the trail showing its path. if (m_IsGameOver) { return; } m_AiCharacter.SetTarget(target.position); m_AgentTrail.SetDestination(); }