コード例 #1
0
ファイル: Player.cs プロジェクト: nebuch/Migros
        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;
        }
コード例 #2
0
ファイル: Player.cs プロジェクト: zhangjingpu/UnityVR
        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();
        }