// Use this for initialization void Start() { player_fire = GetComponent <Player_Fire> (); yButtManager = GetComponent <YButtonManager> (); last_fire = Time.time; }
// Update is called once per frame void Update() { for (int i = 0; i < transform.childCount; i++) { transform.GetChild(i).gameObject.SetActive(YButtonManager.abilityIsUnlocked()); } }
// Initialization void Start() { player_fire = GetComponent <Player_Fire> (); player_missile_fire = GetComponent <Player_Missile_Fire> (); yButtManager = GetComponent <YButtonManager> (); move = transform.root.GetComponentInChildren <PlayerMove> (); last_fire = Time.time; }
// Call this to purchase/enable a pilot upgrade public static void purchasePilotUpgrade(pilotEffect toPurchase) { int total = pilotUpgrades [toPurchase] + 1; pilotUpgrades [toPurchase] = total; if (toPurchase == pilotEffect.health) { PlayerHP.UpgradePlayerHP(total); } else if (toPurchase == pilotEffect.bombDR) { DropManager.upgradeDR(DropType.BombCharge, total); } else if (toPurchase == pilotEffect.healthDR) { DropManager.upgradeDR(DropType.Health, total); } else if (toPurchase == pilotEffect.sprint_cooldown) { PlayerMove.UpgradeSprintCooldown(total); } else if (toPurchase == pilotEffect.sprint_evasion) { PlayerHP.UpgradeEvasionOdds(total); } else if (toPurchase == pilotEffect.dash) { PlayerMove.UpgradeDashEnabled(total); } else if (toPurchase == pilotEffect.dash_cooldown) { PlayerMove.UpgradeDashCoolDown(total); } else if (toPurchase == pilotEffect.dash_damage) { PlayerMove.UpgradeDashKill(total); } else if (toPurchase == pilotEffect.dash_longer) { PlayerMove.UpgradeDashLength(total); } else if (toPurchase == pilotEffect.dash_wider) { PlayerMove.UpgradeDashLength(total); } else if (toPurchase == pilotEffect.turtle) { turtle_script.upgrade_turtle(total); } else if (toPurchase == pilotEffect.turtle_decoy) { turtle_script.upgrade_decoy(total); } else if (toPurchase == pilotEffect.turtle_duration) { turtle_script.upgrade_dur(total); } else if (toPurchase == pilotEffect.turtle_move) { turtle_script.upgrade_move(total); } else if (toPurchase == pilotEffect.turtle_reflect) { turtle_script.upgrade_reflect(total); } else if (toPurchase == pilotEffect.Y_rapidFire) { YButtonManager.UnlockRapidFire(total); } else if (toPurchase == pilotEffect.Y_turretMode) { YButtonManager.UnlockTurretMode(total); } }
// Call this to purchase/enable a gunner upgrade public static void purchaseGunnerUpgrade(gunnerEffect toPurchase) { int total = gunnerUpgrades [toPurchase] + 1; gunnerUpgrades [toPurchase] = total; if (toPurchase == gunnerEffect.A_fireRate) { Player_Fire.UpgradeFireRate(total); } else if (toPurchase == gunnerEffect.A_range) { bullet_range.upgradeRange(total); } else if (toPurchase == gunnerEffect.A_ricochet) { Player_Fire.UpgradeRicochet(total); } else if (toPurchase == gunnerEffect.A_multishot) { Player_Fire.UpgradeMultishot(total); } else if (toPurchase == gunnerEffect.A_wideBullets) { Player_Fire.UpgradeBulletWidth(total); } else if (toPurchase == gunnerEffect.missile) { Player_Missile_Fire.UnlockMissiles(total); } else if (toPurchase == gunnerEffect.missile_cooldown) { Player_Missile_Fire.UpgradeCooldown(total); } else if (toPurchase == gunnerEffect.missile_explosions) { Player_Missile_Fire.UpgradeExplosionRadius(total); } else if (toPurchase == gunnerEffect.missile_tripleShot) { Player_Missile_Fire.EnableTripleShot(total); } else if (toPurchase == gunnerEffect.missile_tracking) { Player_Missile_Fire.EnableTracking(total); } else if (toPurchase == gunnerEffect.sword) { sword_script.upgrade_enabled(total); } else if (toPurchase == gunnerEffect.sword_destroyProj) { sword_script.upgrade_projectiles(total); } else if (toPurchase == gunnerEffect.sword_duration) { sword_script.upgrade_dur(total); } else if (toPurchase == gunnerEffect.sword_range) { sword_script.upgrade_range(total); } else if (toPurchase == gunnerEffect.sword_spin) { sword_script.upgrade_spins(total); } else if (toPurchase == gunnerEffect.Y_slowMo) { YButtonManager.UnlockSlowMo(total); } else if (toPurchase == gunnerEffect.Y_starMode) { YButtonManager.UnlockStarMode(total); } }
// Initialization void Start() { yButtManager = transform.root.GetComponentInChildren <YButtonManager> (); }