Exemple #1
0
 //When the player clicks the mini powerup
 public virtual void OnMouseDown()
 {
     if (this.name == "MiniPower")
     {
         PowerupControl.UsePowerup(this.name, 20);
         //AddScore();
         Destroy(this.gameObject);
     }
 }
Exemple #2
0
 /* Only called when ther is a collision with spaceship and Powerup
  * 'Uses' the powerup & relocates it
  */
 public virtual void OnTriggerEnter(Collider other)
 {
     if (other.CompareTag("Player"))
     {
         //Debug.Log("Collision");
         Vector3 SpaceshipPosition = GameObject.Find("Spaceship").transform.position;
         PowerupControl.UsePowerup(Capsule.tag, scoreToAdd);
         //Relocate powerup to later in the game (Bigger Z axis number)
         RelocatePowerup(SpaceshipPosition);
     }
 }