Пример #1
0
 void Start()
 {
     if (transform.childCount > 0)
     {
         door = transform.GetChild(0);
     }
     player             = GameObject.FindGameObjectWithTag(Tags.player);
     playerInventory    = player.GetComponent <fps_PlayerInventory>();
     audioSources       = this.GetComponent <AudioSource>();
     door.localPosition = from;
 }
Пример #2
0
 void Start()                          //初始化
 {
     if (transform.childCount > 0)     //transform.childCount:获取子物体数量
     {
         door = transform.GetChild(0); //获取子物体
     }
     player             = GameObject.FindGameObjectWithTag(Tags.player);
     playerInventory    = player.GetComponent <fps_PlayerInventory>();
     audioSources       = this.GetComponent <AudioSource>();
     door.localPosition = from;//设置门的初始位置
 }
Пример #3
0
 void Start()
 {
     player          = GameObject.FindGameObjectWithTag(Tags.player);
     playerInventory = player.GetComponent <fps_PlayerInventory>();
 }