Ejemplo n.º 1
0
        public override void ProcessFrame(Playable playable, FrameData info, object playerData)
        {
            base.ProcessFrame(playable, info, playerData);

            if (!speakerSet)
            {
                ScriptPlayable <SpeechPlayableBehaviour> clip = (ScriptPlayable <SpeechPlayableBehaviour>)playable.GetInput(0);
                SpeechPlayableBehaviour shot = clip.GetBehaviour();
                if (shot != null)
                {
                    speakerSet = true;
                    speaker    = shot.Speaker;
                }
            }

            for (int i = 0; i < playable.GetInputCount(); ++i)
            {
                float weight = playable.GetInputWeight(i);
                if (weight > 0f)
                {
                    return;
                }
            }

            if (playbackMode == SpeechTrackPlaybackMode.ClipDuration || !Application.isPlaying)
            {
                StopSpeaking();
            }
        }
Ejemplo n.º 2
0
        public override Playable CreatePlayable(PlayableGraph graph, GameObject owner)
        {
            SpeechPlayableBehaviour template = new SpeechPlayableBehaviour();
            var playable = ScriptPlayable <SpeechPlayableBehaviour> .Create(graph, template);

            SpeechPlayableBehaviour clone = playable.GetBehaviour();

            clone.Init(speechPlayableData, speaker, speechTrackPlaybackMode, trackInstanceID);

            return(playable);
        }