public void AnimationCalled(string key, AudioClip Audio, FaceExpressions Test, objectsinHand objs) { StopAllCoroutines(); ScrollItems[ThemeIndex].SelectOption.SetActive(true); if (effectinstantiated) { Destroy(effectinstantiated); } bodyAudio.clip = Audio; bodyAudio.Play(); emmotionStart(Test); StartCoroutine(StopAnimation(Audio.length)); animationCharecter.Play(key); StartCoroutine(ActivateObjects(objs)); //animationNameText.text = animationCharecter.GetCurrentAnimatorClipInfo(0)[0].clip.name; }
public IEnumerator ActivateObjects(objectsinHand Keys) { foreach (var obj in Keys.objectinHand) { yield return(new WaitForSeconds(obj.startTime)); foreach (var objs in Keys.objectList) { foreach (GameObject pickup in objs.objectsToactivate) { if (pickup.name == obj.objectName) { pickup.SetActive(true); StartCoroutine(DisableObjects(obj.endTime, pickup)); } } } } }