Ejemplo n.º 1
0
 // Use this for initialization.
 void Start()
 {
     driver       = transform.GetComponentInParent <Driver> ();
     floorTracker = transform.GetComponentInParent <FloorTracker> ();
     uiSource     = GetComponent <AudioSource> ();
     engineSource = transform.parent.GetComponent <AudioSource> ();
     targetSound  = transform.FindChild("Target Sound").gameObject;
     targetSource = targetSound.GetComponent <AudioSource> ();
     ChangeTarget(0, false);
 }
Ejemplo n.º 2
0
 // Use this for initialization.
 void Start()
 {
     if (hazards == null)
     {
         hazards = new GameObject[0];
     }
     hazardCounters = new int[hazards.Length];
     for (int i = 0; i < hazards.Length; i++)
     {
         float distance = Vector3.Distance(hazards[i].transform.position, transform.parent.position);
         hazardCounters[i] = 10 + (int)(distance * 9 / 10);
     }
     controller = GetComponentInParent <AudioController> ();
     source     = GetComponent <AudioSource> ();
     tracker    = GetComponentInParent <FloorTracker> ();
 }
Ejemplo n.º 3
0
 // Use this for initialization.
 void Start()
 {
     tracker    = GetComponent <FloorTracker> ();
     controller = GetComponentInChildren <AudioController> ();
 }