void OnTriggerEnter(Collider other)
 {
     if (other.transform.tag == "train")
     {
         CmdStorageBehaviour storage = other.gameObject.GetComponent <CmdStorageBehaviour>();
         List <CommandObj>   com     = storage.Commands;
         GetComponent <CmdTransmitBehaviour>().SendCmd(com);
         other.GetComponentsInChildren <AudioSource>()[1].Play();
     }
 }
示例#2
0
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else if (instance != this)
     {
         Destroy(gameObject);
     }
 }
示例#3
0
 // Use this for initialization
 void Start()
 {
     storage = GetComponent <CmdStorageBehaviour>();
 }