Ejemplo n.º 1
0
 public void Launch(Missile missile, LaunchCode code, UsedLaunchCodes usedCodes)
 {
     if (code.isValidCode() && !usedCodes.Contains(code))
     {
         missile.Launch();
         usedCodes.Add(code);
     }
     else
     {
         missile.Disable();
     }
 }
Ejemplo n.º 2
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.gameObject.CompareTag("Missile"))
     {
         Missile missile = collision.gameObject.GetComponent <Missile>();
         missile.playerWhoShot.AddScore();
         missile.Disable();
         SetAsDisabled();
         asteroidSpawn.AddDisabledAsteroid();
         asteroidSpawn.VerifyIfAllAsteroidsAreDisabled();
         asteroidSpawn.InstatiatedParticles[Index].Play();
     }
 }