Beispiel #1
0
 // If the minion is hit by its color it is killed
 public override void AttackedBy(Palette.PalColor attackColor)
 {
     if (attackColor == this.color)
     {
         this.Die();
     }
 }
Beispiel #2
0
 // Casts a color on all enemies
 public void CastColor(Palette.PalColor color)
 {
     foreach (Enemy e in enemies)
     {
         e.AttackedBy(color);
     }
 }
Beispiel #3
0
 public override void AttackedBy(Palette.PalColor attackColor)
 {
     if (eyes[nextEyeIndex].IsColor(attackColor))
     {
         eyes[nextEyeIndex].KillEye();
         nextEyeIndex++;
         if (nextEyeIndex == eyes.Length)
         {
             this.Die();
         }
     }
 }
Beispiel #4
0
 private Eye[] GetEyes(int numEyes)
 {
     Eye[] eyes = new Eye[numEyes];
     for (int i = 0; i < numEyes; i++)
     {
         eyes[i] = Instantiate(eyeTemplate);
         eyes[i].transform.parent = this.transform;
         Palette.PalColor randomColor = (Palette.PalColor)Random.Range(4, 7);
         eyes[i].SetColorPos(randomColor, eyePositions[i]);
     }
     return(eyes);
 }
Beispiel #5
0
 public bool IsColor(Palette.PalColor p)
 {
     return(p == this.color);
 }
Beispiel #6
0
 public void SetColorPos(Palette.PalColor c, Vector2 p)
 {
     color                   = c;
     image.sprite            = eyeImages[(int)color - 4]; // todo: fix
     transform.localPosition = p;
 }
Beispiel #7
0
 // Called when a color is cast on the enemy
 public abstract void AttackedBy(Palette.PalColor attackColor);