// Update is called once per frame void Update() { if (baseHealth < 1) { Debug.Log("DEATH! Too many Planes made it through your Defenses"); // death state // restart game } if (Input.GetButtonDown("CycleWeapon")) { Debug.Log("Weapon cylced"); switch (currentWeapon) { case PLANETYPES.BOMBER: currentWeapon = PLANETYPES.EAGLE; weaponChoiceObj.GetComponent <MeshFilter>().mesh = planeMeshes[1]; break; case PLANETYPES.EAGLE: currentWeapon = PLANETYPES.THUNDER; weaponChoiceObj.GetComponent <MeshFilter>().mesh = planeMeshes[2]; break; case PLANETYPES.THUNDER: currentWeapon = PLANETYPES.BOMBER; weaponChoiceObj.GetComponent <MeshFilter>().mesh = planeMeshes[0]; break; } } }
// Use this for initialization void Start() { SetPlaneTypes(); baseHealth += EnemyPlanes.Length; StartCoroutine(SetPlaneToSpawn()); currentWeapon = PLANETYPES.BOMBER; weaponChoiceObj.GetComponent <MeshFilter>().mesh = planeMeshes[0]; }