当前位置: 首页>>代码示例>>C#>>正文


C# Transform.Find方法代码示例

本文整理汇总了C#中UnityEngine.Transform.Find方法的典型用法代码示例。如果您正苦于以下问题:C# Transform.Find方法的具体用法?C# Transform.Find怎么用?C# Transform.Find使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UnityEngine.Transform的用法示例。


在下文中一共展示了Transform.Find方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Initialize

 void Initialize()
 {
     m_Transform = transform;
     m_lblReport = m_Transform.Find("txtBattleReport").GetComponentsInChildren<UILabel>(true)[0];
     m_imgReport = m_Transform.Find("imgBattleReport").GetComponentsInChildren<UISprite>(true)[0];
     m_bgReport = m_Transform.Find("bgBattleReport").GetComponentsInChildren<UISlicedSprite>(true)[0];
 }
开发者ID:lbddk,项目名称:ahzs-client,代码行数:7,代码来源:BattleReportUnit.cs

示例2: Initialize

 void Initialize()
 {
     m_Transform = transform;
     
     m_lblRankingUIPlayerRankDataName = m_Transform.Find("RankingUIPlayerRankDataName").GetComponentsInChildren<UILabel>(true)[0];
     m_lblRankingUIPlayerRankDataRank = m_Transform.Find("RankingUIPlayerRankDataRank").GetComponentsInChildren<UILabel>(true)[0];
 }
开发者ID:lbddk,项目名称:ahzs-client,代码行数:7,代码来源:RankingUIPlayerRankData.cs

示例3: Initialize

 void Initialize()
 {
     m_Transform = transform;
     m_lblRankingUITabTextUp = m_Transform.Find("RankingUITabTextUp").GetComponentsInChildren<UILabel>(true)[0];
     m_lblRankingUITabTextDown = m_Transform.Find("RankingUITabTextDown").GetComponentsInChildren<UILabel>(true)[0];
     m_goRankingUITabReward = m_Transform.Find("RankingUITabReward").gameObject;
 }
开发者ID:lbddk,项目名称:ahzs-client,代码行数:7,代码来源:RankingUITabGrid.cs

示例4: Start

    void Start()
    {
        GameObject mapControlObj = GameObject.Find("MapControl");
        mapControl = mapControlObj.GetComponent<MapControl>();

        Transform textBox = transform.Find("UpperLeft/TextBox");
        mapControl.SetTextBox(textBox.GetComponent<MapTextBox>());

        upperLeft = transform.Find("UpperLeft");
        Camera.main.transform.GetComponent<UIManager>().lockToEdge(upperLeft);

        upperRight = transform.Find("UpperRight");
        Camera.main.transform.GetComponent<UIManager>().lockToEdge(upperRight);
        upperRight.gameObject.AddComponent<InputRepeater>().SetTarget(mapControl.transform);

        lowerLeft = transform.Find("LowerLeft");
        Camera.main.transform.GetComponent<UIManager>().lockToEdge(lowerLeft);
        Transform playerName = lowerLeft.Find("PlayerName");
        Transform playerScore = lowerLeft.Find("PlayerScore");

        lowerRight = transform.Find("LowerRight");
        Camera.main.transform.GetComponent<UIManager>().lockToEdge(lowerRight);
        Transform enemyName = lowerRight.Find("EnemyName");
        Transform enemyScore = lowerRight.Find("EnemyScore");

        mapControl.InitScoreboard(playerName, playerScore, enemyName, enemyScore);
    }
开发者ID:Diggery,项目名称:SuperSneak,代码行数:27,代码来源:MapUI.cs

示例5: Start

 // Use this for initialization
 void Start()
 {
     player = GameObject.Find("/Player").transform;
     turret = transform.Find("scavenger_air_main_group/scavenger_weapon_group/scavenger_air_gun");
     leftLaser = turret.Find("Default/LeftLaser").GetComponent<ParticleSystem>();
     rightLaser = turret.Find("Default/RightLaser").GetComponent<ParticleSystem>();
 }
开发者ID:Junuxx,项目名称:MiniLD-62,代码行数:8,代码来源:AirScavenger.cs

示例6: Update

	protected void Update()
	{
		if(player == null || weapon == null || eyes == null)
		{
			Entity p = EntityUtils.GetEntityWithTag("Player");

			if(p == null)
			{
				Debug.LogError("No player found");
				return;
			}

			player = p.transform;
			weapon = player.Find("Weapon");
			eyes = player.Find("Eyes");
		}

		if(Cursor.visible || Cursor.lockState != CursorLockMode.Locked)
		{
			if(Input.GetMouseButtonDown(0))
			{
				Cursor.lockState = CursorLockMode.Locked;
				Cursor.visible = false;
			}
		}

		UpdateCamera();

		// Move the camera to the player's eyes
		Camera.main.transform.position = eyes.position;
		Camera.main.transform.rotation = eyes.rotation;
	}
开发者ID:Snakybo-School,项目名称:OUTGEFOUND,代码行数:32,代码来源:GameCamera.cs

示例7: CustomizeListObject

	// Customize this function to fill the contents of the item at Id
	// This will be called as an item comes into view, so don't do any crazy
	// processing in here. It is possible to start a coroutine to cache a profile
	// picture, for instance.
	void CustomizeListObject( Transform contentRoot, int itemId ) {
		contentRoot.Find("Name").GetComponent<tk2dTextMesh>().text = allItems[itemId].name;
		contentRoot.Find("Score").GetComponent<tk2dTextMesh>().text = "Score: " + allItems[itemId].score;
		contentRoot.Find("Time").GetComponent<tk2dTextMesh>().text = "Time: " + allItems[itemId].time;
		contentRoot.Find("Portrait").GetComponent<tk2dBaseSprite>().color = allItems[itemId].color;
		contentRoot.localPosition = new Vector3(itemId * itemStride, 0, 0);
	}
开发者ID:Eddikos,项目名称:public-access-1,代码行数:11,代码来源:tk2dUIDemo6Controller.cs

示例8: ApplyAsteroidName

 // set label for asteroid
 public static void ApplyAsteroidName(Transform obj)
 {
     switch(Show)
         {
         case (int)Option.none:
         obj.Find("label").gameObject.SetActiveRecursively(false);
         break;
         case (int)Option.self:
         obj.Find("label").gameObject.SetActiveRecursively(false);
         break;
         case (int)Option.aura:
         if( IsAsteroidInAura(obj.name) == true)
         {
             obj.Find("label").gameObject.SetActiveRecursively(true);
         }
         else
         {
             obj.Find("label").gameObject.SetActiveRecursively(false);
         }
         break;
         case (int)Option.nimbus:
         obj.Find("label").gameObject.SetActiveRecursively(true);
         break;
         }
 }
开发者ID:ZeningQu,项目名称:NDNMOG,代码行数:26,代码来源:ControlLabels.cs

示例9: Init

 private void Init()
 {
     m_transform = this.transform;
     btn_head = m_transform.Find("btn_head").GetComponent<Button>();
     btn_skill = m_transform.Find("btn_skill").GetComponent<Button>();
     bar_hp = m_transform.Find("bar_hp").GetComponent<Image>();
     img_head = m_transform.Find("Image 1").GetComponent<Image>();
 }
开发者ID:zhaoyabo,项目名称:GameBase,代码行数:8,代码来源:UIFightHeroHead.cs

示例10: LoadMesh

 private void LoadMesh(WWW www, string location)
 {
     car = componentScrollView.car.transform;
     car.Find("3D Models at 3dxy").Find(location).GetComponent<MeshFilter>().mesh =
         ((GameObject)(www.assetBundle.mainAsset)).GetComponent<MeshFilter> ().mesh;
     car.Find("3D Models at 3dxy").Find(location).renderer.material = ((GameObject)(www.assetBundle.mainAsset)).renderer.material;
     www.assetBundle.Unload (false);
 }
开发者ID:Jermmy,项目名称:CarModel,代码行数:8,代码来源:TypeItem.cs

示例11: setEnergyUI

 public void setEnergyUI(Transform tr) {
   gauge = tr.Find("EnergyBarGuage").GetComponent<Image>();
   gaugeShell = tr.Find("EnergyBarShell").gameObject;
   gaugeIcon = tr.Find("EnergyBarIcon").gameObject;
   noDeath = true;
   energySystemOn = true;
   losePerSec = CharacterManager.cm.energyReduceOnTimeStandard;
   lessDamageRate = CharacterManager.cm.damageGetScaleStandard;
 }
开发者ID:spilist,项目名称:shoong,代码行数:9,代码来源:EnergyManager.cs

示例12: Init

    static GameObject NoBtn;//否定按钮

    public static void Init(Transform ui)
    {
        UI = ui;
        Tween = UI.GetComponent<UIPlayTween>();
        PromptLab = UI.Find("PromptBg/Prompt").GetComponent<UILabel>();
        OkBtn = UI.Find("PromptBg/Ok").gameObject;
        YesBtn = UI.Find("PromptBg/Yes").gameObject;
        NoBtn = UI.Find("PromptBg/No").gameObject;
    }
开发者ID:JingChen1988,项目名称:Bubble,代码行数:11,代码来源:PromptUI.cs

示例13: CustomizeListObject

	void CustomizeListObject( Transform contentRoot ) {
		string[] firstPart = { "Ba", "Po", "Re", "Zu", "Meh", "Ra'", "B'k", "Adam", "Ben", "George" };
		string[] secondPart = { "Hoopler", "Hysleria", "Yeinydd", "Nekmit", "Novanoid", "Toog1t", "Yboiveth", "Resaix", "Voquev", "Yimello", "Oleald", "Digikiki", "Nocobot", "Morath", "Toximble", "Rodrup", "Chillaid", "Brewtine", "Surogou", "Winooze", "Hendassa", "Ekcle", "Noelind", "Animepolis", "Tupress", "Jeren", "Yoffa", "Acaer" };
		string name = firstPart[Random.Range(0, firstPart.Length)] + " " + secondPart[Random.Range(0, secondPart.Length)];
 		Color color = new Color32((byte)Random.Range(192, 255), (byte)Random.Range(192, 255), (byte)Random.Range(192, 255), 255);
		contentRoot.Find("Name").GetComponent<tk2dTextMesh>().text = name;
		contentRoot.Find("HP").GetComponent<tk2dTextMesh>().text = "HP: " + Random.Range(100, 512).ToString();
		contentRoot.Find("MP").GetComponent<tk2dTextMesh>().text = "MP: " + (Random.Range(2, 40) * 10).ToString();
		contentRoot.Find("Portrait").GetComponent<tk2dBaseSprite>().color = color;
	}
开发者ID:Eddikos,项目名称:public-access-1,代码行数:10,代码来源:tk2dUIDemo5Controller.cs

示例14: Init

 private void Init()
 {
     mTransform = this.transform;
     goBgRange = mTransform.Find("Panel/bg_range").gameObject;
     goCellRange = goBgRange.transform.Find("Panel/cell_range1").gameObject;
     goCellServer = mTransform.Find("Panel/bg_server/Panel/cell_server").gameObject;
     goRangePanel = mTransform.Find("Panel/bg_range").gameObject;
     goServerPanel = mTransform.Find("Panel/bg_server").gameObject;
     SetRangeList();
 }
开发者ID:zhaoyabo,项目名称:GameBase,代码行数:10,代码来源:UIServerlist.cs

示例15: Start

    void Start()
    {
        Cannon = CannonCtl.Instance;

        UITran = transform.Find("Main");
        //切换泡泡
        UIEventListener.Get(UITran.Find("BtnSwap").gameObject).onClick = sender => Cannon.SwapBubble();
        //控制炮口
        UIEventListener.Get(UITran.Find("CannonArea").gameObject).onPress = (sender, isPress) => Cannon.ControlMuzzle(isPress);
    }
开发者ID:JingChen1988,项目名称:Bubble,代码行数:10,代码来源:GameUI.cs


注:本文中的UnityEngine.Transform.Find方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。