예제 #1
0
 void spawnTram(int tramNumber)
 {
     // vytvor električku
     if (tramNumber == 1)
     {
         tram1 = Instantiate(tramPrefab, spawnPoint1, Quaternion.identity, this.transform);
     }
     else if (tramNumber == 2)
     {
         Vector3 rotation = new Vector3(0f, -180f, 0f);
         tram2 = Instantiate(tramPrefab, spawnPoint2, Quaternion.Euler(rotation), this.transform);
         Elektricka tramComponent = tram2.GetComponent <Elektricka>();
         tramComponent.directionVector = tramComponent.directionVector * -1f;
     }
 }
예제 #2
0
 // Start is called before the first frame update
 void Start()
 {
     trigger = GetComponentInChildren <TimelineTrigger>();
     autobus = GetComponent <Elektricka>();
 }