亚洲免费一级高潮_欧美极品白嫩视频在线_中国AV片在线播放_欧美亚洲日韩欧洲在线看

您現(xiàn)在所在的位置:首頁 >關(guān)于奇酷 > 行業(yè)動態(tài) > unity3D培訓(xùn)實戰(zhàn):獲取游戲?qū)ο髱追N方法如下

unity3D培訓(xùn)實戰(zhàn):獲取游戲?qū)ο髱追N方法如下

來源:奇酷教育 發(fā)表于:

  對于前幾篇對unity3D的介紹,包括什么是unity3D?學(xué)習(xí)unity3D培訓(xùn)能做什么?unity3D界面操作等。今天咱們來說說unity3D培訓(xùn)實戰(zhàn):獲取

  對于前幾篇對unity3D的介紹,包括什么是unity3D?學(xué)習(xí)unity3D培訓(xùn)能做什么?unity3D界面操作等。今天咱們來說說unity3D培訓(xùn)實戰(zhàn):獲取游戲?qū)ο髱追N方法。
  一:通過對象名稱(Find方法)
  二:通過標(biāo)簽獲取單個游戲?qū)ο螅‵indWithTag方法)
  三:通過標(biāo)簽獲取多個游戲?qū)ο螅‵indGameObjectsWithTags方法)
  四:通過類型獲取單個游戲?qū)ο螅‵indObjectOfType方法)
  五:通過類型獲取多個游戲?qū)ο螅‵indObjectsOfType方法)
  下面以Find方法為例,為大家演示下。
  static GameObject Find (string name)
  傳入的name可以是單個的對象的名字,也可以是hierarchy中的一個路徑名,如果找到會返回該對象(活動的),如果找不到就返回null。
  [csharp] view plain copy
  var cubeF = GameObject.Find("/CubeFather");
  if (null != cubeF)
  {
  Debug.Log("find cube father~");
  }
  cubeF = GameObject.Find("CubeFather");
  if (null != cubeF)
  {
  Debug.Log("find cube father, no /~");
  }
  var cubeS = GameObject.Find("/CubeFather/CubeSon");
  if (null != cubeS)
  {
  Debug.Log("find cube son~");
  }
  cubeS = GameObject.Find("CubeFather/CubeSon");
  if (null != cubeS)
  {
  Debug.Log("find cube son, no /~");
  }
  cubeS = GameObject.Find("CubeSon");
  if (null != cubeS)
  {
  Debug.Log("find cube son, no one /~");
  }
        以上就是奇酷小編為大家講解的unity3D培訓(xùn)實戰(zhàn):獲取游戲?qū)ο髱追N方法,想深入了解請聯(lián)系我們。