void Update() { if (switchAvailable && PlayerMovementAnimated.canMove) { if (Input.GetButtonDown("SwitchToAirDragon") && DragonTypeV != eDragonType.AirDragon) { DragonTypeV = eDragonType.AirDragon; ChangeDragonColor(); PauseSwitching(); } if (Input.GetButtonDown("SwitchToWaterDragon") && DragonTypeV != eDragonType.WaterDragon) { DragonTypeV = eDragonType.WaterDragon; ChangeDragonColor(); PauseSwitching(); } if (Input.GetButtonDown("SwitchToFireDragon") && DragonTypeV != eDragonType.FireDragon) { DragonTypeV = eDragonType.FireDragon; ChangeDragonColor(); PauseSwitching(); } if (Input.GetButtonDown("SwitchToEarthDragon") && DragonTypeV != eDragonType.EarthDragon) { DragonTypeV = eDragonType.EarthDragon; ChangeDragonColor(); PauseSwitching(); } } }
IEnumerator SuperPowerOver(eDragonType dragonBeforeSuper) { yield return(new WaitForSeconds(superPowerDuration)); DragonTypeV = dragonBeforeSuper; ChangeDragonColor(); SwitchingOk(); EventManager.TriggerManaReset(); }
public void TriggerSuperPower() { eDragonType dragonBeforeSuperPower = DragonTypeV; DragonTypeV = eDragonType.SuperDragon; ChangeDragonColor(); switchAvailable = false; StartCoroutine(SuperPowerOver(dragonBeforeSuperPower)); }