void OnTriggerEnter(Collider SpawnTrigger)
    {
        if (SpawnTrigger.CompareTag("Terrain"))
        {
            GameManager.SpawnTerrain = true;
        }
        if (SpawnTrigger.CompareTag("Score"))
        {
            Destroy(SpawnTrigger.gameObject);
            GoldFever.GoldCount++;
            print("Scored");
        }

        if (SpawnTrigger.CompareTag("Ammo"))
        {
            RocketData.RocketCount++;
            data.ApplyRocketCount();
            data.LoadRocketCount();
            Destroy(SpawnTrigger.gameObject);
        }


        if (SpawnTrigger.CompareTag("Mine"))
        {
            print("GAME OVER");
            PlaneMovements.Dead = true;
            Destroy(SpawnTrigger.gameObject);
        }
    }
示例#2
0
 public void Shoot()
 {
     if (RocketData.RocketCount != 0)
     {
         RocketPosition   = transform.position;
         RocketPosition.x = RocketPosition.x + 6f;
         RocketPrefab.gameObject.transform.position = RocketPosition;
         Instantiate(RocketPrefab);
         RocketData.RocketCount--;
         data.ApplyRocketCount();
         data.LoadRocketCount();
     }
 }