Ejemplo n.º 1
0
    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);
    }
Ejemplo n.º 2
0
    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);
        }
    }
Ejemplo n.º 3
0
    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;
    }