private IEnumerator Die() { _flag.AddActivity(this); _panda.StartAnimationState(PandaAnimationState.Dying); Debug.Log("Staring death of panda becouse of hunger"); SoundManager.instance.PlayOneShotSound(SoundType.Dying); yield return(new WaitForSeconds(DyingTime)); Debug.Log("Killing panda becouse of hunger"); if (FindObjectsOfType <DummyPanda>().ToList().Count <= 2) { FindObjectOfType <GameOverScreen>()?.MakeVisible(); } GameObject.Destroy(gameObject); }
private IEnumerator MatingCoroutine(PandaMatingActivityArea otherPandaMatingActivityArea) { _flag.AddActivity(otherPandaMatingActivityArea); _thisPanda.ChangeEro(_SexEroCost); _thisPanda.GetComponentNotNull <NavMeshAgent>().velocity = Vector3.zero; _thisPanda.GetComponentNotNull <NavMeshAgent>().isStopped = true; _thisPanda.StartAnimationState(PandaAnimationState.Sexing); Debug.Log("Fucky-fucky"); SoundManager.instance.PlaySustainedTheme(_thisPanda.gameObject, SoundType.Sex, _SexTime + 0.3f); yield return(new WaitForSeconds(_SexTime)); _thisPanda.GetComponentNotNull <NavMeshAgent>().isStopped = false; _thisPanda.StopAnimationState(PandaAnimationState.Sexing); if (_thisPanda.GetGender() == Gender.Female) { SoundManager.instance.PlayOneShotSound(SoundType.Yay); Debug.Log("Created child"); ChildPandaCreator.InstantianteChild(_thisPanda.gameObject, otherPandaMatingActivityArea._thisPanda.gameObject); } _flag.RemoveActivity(otherPandaMatingActivityArea); }