亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定

為什么運行起來一直不對

using System.Collections;

using System.Collections.Generic;

using UnityEngine;


public class NewBehaviourScript : MonoBehaviour {

Transform translight;

Transform translight2;

public Transform ?TransRoot;


// Use this for initialization

void Start () {

? ? ? ? FindChild(TransRoot, "Light1", ref translight);

? ? ? ? FindChild(TransRoot, "Light2", ref translight2);

? ? ? ? translight.GetComponent<Light>().color = Color.red;

}

? ? /// <summary>

? ? /// 尋找物體

? ? /// </summary>

? ? /// <param name="trans">作為父物體的transform</param>

? ? /// <param name="findName">尋找的物體名稱</param>

? ? /// <param name="_trans">找到的物體</param>

void FindChild(Transform trans,string findName,ref Transform _trans)

? ? {

? ? ? ? if (trans.name.Equals(findName))

? ? ? ? {

? ? ? ? ? ? _trans = trans.transform;

? ? ? ? ? ? return;

? ? ? ? }

? ? ? ? if (trans.childCount != 0)

? ? ? ? {

? ? ? ? ? ? for(int i = 0, length = trans.childCount; i <length; i++)

? ? ? ? ? ? {

? ? ? ? ? ? ? ? FindChild(trans.GetChild(i), findName, ref _trans);

? ? ? ? ? ? }

? ? ? ? }

? ? }

// Update is called once per frame

void Update () {

}

}



正在回答

1 回答

具體說一下,或截個圖

0 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消

為什么運行起來一直不對

我要回答 關注問題
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號