예제 #1
0
        public void SetTranslationID(int index, int lineID)
        {
            SpeechPlayableClip clip = GetClip(index);

            clip.speechPlayableData.lineID = lineID;
            UnityEditor.EditorUtility.SetDirty(clip);
        }
예제 #2
0
        public override Playable CreateTrackMixer(PlayableGraph graph, GameObject go, int inputCount)
        {
            foreach (TimelineClip timelineClip in GetClips())
            {
                SpeechPlayableClip clip = (SpeechPlayableClip)timelineClip.asset;
                timelineClip.displayName = clip.GetDisplayName();

                Char speaker = null;
                if (Application.isPlaying)
                {
                    if (isPlayerLine)
                    {
                        speaker = AssignPlayer(playerID);
                    }
                    else if (speakerConstantID != 0)
                    {
                        speaker = ConstantID.GetComponent <Char> (speakerConstantID);
                    }
                }
                else
                {
                    if (isPlayerLine)
                    {
                        if (KickStarter.settingsManager != null)
                        {
                            if (KickStarter.settingsManager.playerSwitching == PlayerSwitching.Allow && playerID >= 0)
                            {
                                PlayerPrefab playerPrefab = KickStarter.settingsManager.GetPlayerPrefab(playerID);
                                if (playerPrefab != null)
                                {
                                    speaker = playerPrefab.playerOb;
                                }
                            }
                            else
                            {
                                speaker = KickStarter.settingsManager.GetDefaultPlayer(false);
                            }
                        }
                    }
                    else
                    {
                        speaker = SpeakerPrefab;
                    }
                }

                clip.speechTrackPlaybackMode = playbackMode;
                clip.speaker         = speaker;
                clip.trackInstanceID = GetInstanceID();
            }

            ScriptPlayable <SpeechPlayableMixer> mixer = ScriptPlayable <SpeechPlayableMixer> .Create(graph);

            mixer.SetInputCount(inputCount);
            mixer.GetBehaviour().trackInstanceID = GetInstanceID();
            mixer.GetBehaviour().playbackMode    = playbackMode;
            return(mixer);
        }
예제 #3
0
        public void UpdateTranslatableString(int index, string updatedText)
        {
            SpeechPlayableClip clip = GetClip(index);

            if (clip != null)
            {
                clip.speechPlayableData.messageText = updatedText;
            }
        }
        public override void OnInspectorGUI()
        {
            SpeechPlayableClip _target = (SpeechPlayableClip)target;

            _target.ShowGUI();

            if (GUI.changed)
            {
                EditorUtility.SetDirty(_target);
            }
        }