void Start() { //获取物体本身 Player = gameObject.transform; //获取脚本内容 game_controller = GameObject.Find("GameController").GetComponent <GameController_b>(); game_controller_b_1 = GameObject.Find("GameController").GetComponent <GameController_b_1>(); musicControlScript = GameObject.Find("Music").GetComponent <MusicController>(); //设置对象为待机 animIndex = 0; }
void Start() { //获取脚本内容 game_controller = GameObject.Find("GameController").GetComponent <GameController_b>(); yanwenzi_anim = GameObject.Find("yanwenzi6_1").GetComponent <Animator>(); if (gameObject.name == "box") { toy_1.SetActive(false); toy_2.SetActive(false); toy_3.SetActive(false); toy_4.SetActive(false); } if (gameObject.name == "bookcase") { book_1.SetActive(false); book_2.SetActive(false); book_3.SetActive(false); } }