// Update is called once per frame void Update() { if (im.GetInputEnabled() && Input.GetKeyDown(spawnKey)) { if (canSpawn && currentSpawnedShip == null && spawnMeterRemaining == spawnMeterMax) { SpawnProjection(); spawnMeterRemaining = 0.0f; } else if (currentSpawnedShip != null) { TeleportToProjection(); } else { AudioSource.PlayClipAtPoint(errorClip, Vector3.back * 500.0f, 0.4f); dfob.ErrorAtIndex(spawnMeterIndex); } } else { if (spawnMeterRemaining < 1.0f && spawnMeterRemaining + spawnMeterRegenRate >= 1.0f) { AudioSource.PlayClipAtPoint(ready, Vector3.back * 500.0f, 0.35f); } spawnMeterRemaining = Mathf.Min(spawnMeterMax, spawnMeterRemaining + spawnMeterRegenRate * Time.timeScale); dfob.SetDispValue(spawnMeterRemaining, spawnMeterIndex); } }
void Update() { if (im.GetInputEnabled() && !isDashing && Input.GetKeyDown(dashKey)) { if (dashRemaining > 0.0f) { StartDash(); } else { AudioSource.PlayClipAtPoint(errorClip, Vector3.back * 500.0f, 0.4f); dfob.ErrorAtIndex(warpIndex); } } else if (isDashing && Input.GetKeyUp(dashKey)) { EndDash(); } }