本文整理汇总了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];
}
示例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];
}
示例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;
}
示例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);
}
示例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>();
}
示例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;
}
示例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);
}
示例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;
}
}
示例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>();
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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();
}
示例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);
}