private IEnumerator ResolveDestruction() { if (OnDeathSound != null) { AudioSupport.PlayClipAt(OnDeathSound, Camera.transform.position); } yield return(new WaitForSeconds(0.3f)); OnDeathEvents.ForEach(x => x.Publish()); Destroy(gameObject); }
private void PlaySound(Health health) { if (!IsDeadly) { return; } if (health == null || health.Role.Equals(OwnedBy)) { return; } if (OnHitSound != null) { AudioSupport.PlayClipAt(OnHitSound, _camera.transform.position); } }
private IEnumerator HealSleep() { if (isFinished) { yield break; } CloseDoor(); AudioSupport.PlayClipAt(sleepSound, gameCamera.transform.position); AudioSupport.PlayClipAt(lullaby, gameCamera.transform.position); yield return(new WaitForSeconds(sleepDuration / 2)); gameState.HealthMap[gameState.CatId] = gameState.MaxHP; yield return(new WaitForSeconds(sleepDuration / 2)); // TODO: Close Door afterwards openDoor.SetActive(true); closedDoor.SetActive(false); isFinished = true; }