示例#1
0
    void DrawRuntimeInspector()
    {
        // Show playback information
        GUILayout.Label(_target.IsPlaying ? "Playing" : "Stopped");
        GUILayout.Label("Playback Time: " + _target.PlaybackTime.ToString());
        GUILayout.Label("Playback Progress: " + _target.Progress.ToString());

        // Show playback control buttons
        GUILayout.BeginHorizontal(EditorStyles.helpBox);
        if (_target.IsPlaying)
        {
            if (GUILayout.Button("Pause"))
            {
                _target.Pause();
            }
        }
        else
        {
            if (GUILayout.Button("Play"))
            {
                _target.Play();
            }
        }
        if (GUILayout.Button("Stop"))
        {
            _target.Stop();
        }
        GUILayout.EndHorizontal();

        EditorUtility.SetDirty(_target);
    }
    //! tzz added for pause the track by name
    public void PauseTrack(string trackName)
    {
        CameraTrack track = null;

        if (_mCamTrackList.TryGetValue(trackName, out track))
        {
            track.Stop();
        }
    }
    //! return end stop position
    public KeyFrameInfo StopTrack(string trackName)
    {
        KeyFrameInfo t_endPos = null;

        CameraTrack track = null;

        if (_mCamTrackList.TryGetValue(trackName, out track))
        {
            t_endPos = track.Stop();

            _mCamTrackList.Remove(trackName);
            GameObject.Destroy(track.gameObject);
        }

        return(t_endPos);
    }