當前位置: 首頁>>代碼示例>>C#>>正文


C# NavMeshAgent.GetComponentInChildren方法代碼示例

本文整理匯總了C#中UnityEngine.NavMeshAgent.GetComponentInChildren方法的典型用法代碼示例。如果您正苦於以下問題:C# NavMeshAgent.GetComponentInChildren方法的具體用法?C# NavMeshAgent.GetComponentInChildren怎麽用?C# NavMeshAgent.GetComponentInChildren使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在UnityEngine.NavMeshAgent的用法示例。


在下文中一共展示了NavMeshAgent.GetComponentInChildren方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Flip

	public void Flip(){ //Flip player character
		flipped = !flipped;
		Player = GameManager.PlayerCharacter.GetComponent<NavMeshAgent>();
		speechBubble = Player.GetComponentInChildren<SpeechBubble>();
	
		Player.transform.localScale = new Vector3 (Player.transform.localScale.x * -1, Player.transform.localScale.y, Player.transform.localScale.z);
		speechBubble.transform.localScale = new Vector3(speechBubble.transform.localScale.x * -1, speechBubble.transform.localScale.y, speechBubble.transform.localScale.z);
	}
開發者ID:imann24,項目名稱:cs327-bestmobilegameever,代碼行數:8,代碼來源:NoahNavPlane.cs

示例2: Start

 // Use this for initialization
 void Start()
 {
     // agentSelected = false;
     agent = GetComponent<NavMeshAgent>();
     //Rend = GetComponent<Renderer>();
     skinRend = agent.GetComponentInChildren<SkinnedMeshRenderer>();
     //Rend.enabled = true;
     cam.enabled = false;
 }
開發者ID:shilon,項目名稱:UnityProjects,代碼行數:10,代碼來源:RobotNavigation.cs

示例3: Flip

	public void Flip(){ //Flip player character
		if(gameObject.GetComponent<NavMeshAgent>()!=null && gameObject.tag!="DontFlip" ) 
		{
			agent = gameObject.GetComponent<NavMeshAgent>();

			flipped = !flipped;
			speechBubble = agent.GetComponentInChildren<SpeechBubble> ();
			agent.transform.localScale = new Vector3 (agent.transform.localScale.x * -1, agent.transform.localScale.y, agent.transform.localScale.z);
			speechBubble.transform.localScale = new Vector3 (speechBubble.transform.localScale.x * -1, speechBubble.transform.localScale.y, speechBubble.transform.localScale.z);

		}
	}
開發者ID:imann24,項目名稱:cs327-bestmobilegameever,代碼行數:12,代碼來源:Interactable.cs

示例4: Start

	// Use this for initialization
	void Start () {
		Player = GameManager.PlayerCharacter.GetComponent<NavMeshAgent>();
		playerMove = Player.GetComponent<NoahMove> ();
		speechBubble = Player.GetComponentInChildren<SpeechBubble>();

	}
開發者ID:imann24,項目名稱:cs327-bestmobilegameever,代碼行數:7,代碼來源:NoahNavPlane.cs


注:本文中的UnityEngine.NavMeshAgent.GetComponentInChildren方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。