Exemplo n.º 1
0
        // EXECUTABLE: ----------------------------------------------------------------------------

        public override IEnumerator Execute(GameObject target, IAction[] actions, int index)
        {
            Transform targetTransform = this.target.GetTransform(target);

            if (targetTransform != null)
            {
                if (this.audioClip != null)
                {
                    AudioManager.Instance.PlaySound2D(this.audioClip);
                }

                FloatingMessageManager.Show(
                    this.message.GetText(), this.color,
                    targetTransform, this.offset, this.time
                    );

                float     waitTime  = Time.time + this.time;
                WaitUntil waitUntil = new WaitUntil(() => Time.time > waitTime || this.forceStop);
                yield return(waitUntil);

                if (this.audioClip != null)
                {
                    AudioManager.Instance.StopSound2D(this.audioClip);
                }
            }

            yield return(0);
        }
Exemplo n.º 2
0
        // EXECUTABLE: ----------------------------------------------------------------------------

        public override IEnumerator Execute(GameObject target, IAction[] actions, int index)
        {
            Transform targetTransform = this.target.GetTransform(target);

            if (targetTransform != null)
            {
                if (this.audioClip != null)
                {
                    AudioMixerGroup voiceMixer = DatabaseGeneral.Load().voiceAudioMixer;
                    AudioManager.Instance.PlayVoice(this.audioClip, 0f, 1f, voiceMixer);
                }

                FloatingMessageManager.Show(
                    this.message.GetText(), this.color,
                    targetTransform, this.offset, this.time
                    );

                float     waitTime  = Time.time + this.time;
                WaitUntil waitUntil = new WaitUntil(() => Time.time > waitTime || this.forceStop);
                yield return(waitUntil);

                if (this.audioClip != null)
                {
                    AudioManager.Instance.StopVoice(this.audioClip);
                }
            }

            yield return(0);
        }