Beispiel #1
0
 // Use this for initialization
 void Start()
 {
     phase  = 0;
     phase1 = this.gameObject.GetComponent <Phase1>();
     phase2 = this.gameObject.GetComponent <Phase2>();
     phase3 = this.gameObject.GetComponent <Phase3>();
     phase4 = this.gameObject.GetComponent <Phase4>();
     phase5 = this.gameObject.GetComponent <Phase5>();
 }
Beispiel #2
0
 private void Start()
 {
     if (instance == null)
     {
         instance = this;
     }
     else
     {
         Destroy(gameObject);
     }
 }
 public void screamOuch(int count)
 {
     Console.WriteLine("Entering ScreamOuch");
     // Phase1 - encountered only one time BEFORE entering the loop
     //if (Phase1 != null) Phase1();
     Phase1?.Invoke();
     for (int i = 1; i <= count; i++)
     {
         Phase2?.Invoke(i, count);
         // Phase2 - encountered count times, once before each WriteLine
         Console.WriteLine($"{Perp} is looking at {Victim} time {i} of {count}");
         Phase3?.Invoke(i, count);
         // Phase3 - encountered count times, once after  each WriteLine
     }
     Phase4?.Invoke();
     // Phase4 - encountered only one time AFTER finishing all iterations of the loop
     Console.WriteLine("Exiting screamOuch");
 }