// Use this for initialization void Start () { GameObject backgd = GameObject.Find ("background"); //调用脚本background中的地图 bg = (background11)backgd.GetComponent (typeof(background11)); GameObject moneyobj = GameObject.Find ("enemy"); //调用脚本background中的地图 monkeyscript = (monkey11)moneyobj.GetComponent (typeof(monkey11)); }
public background11 bg; //调用脚本background中的地图 // Use this for initialization void Start() { GameObject backgd = GameObject.Find("background"); //调用脚本background中的地图 bg = (background11)backgd.GetComponent(typeof(background11)); }
public background11 bg;//调用脚本background中的地图 // Use this for initialization void Start () { GameObject backgd = GameObject.Find ("background"); //调用脚本background中的地图 bg = (background11)backgd.GetComponent (typeof(background11)); }