Example #1
0
 void DrawPlaybackUI(TransformRecorder transformRecorder)
 {
     if (GUILayout.Button("Play"))
     {
         transformRecorder.StartPlayback();
     }
 }
Example #2
0
        public override void OnInspectorGUI()
        {
            DrawDefaultInspector();

            TransformRecorder transformRecorder = target as TransformRecorder;

            if (EditorApplication.isPlaying)
            {
                if (transformRecorder.mode == TransformRecorder.Mode.Record)
                {
                    DrawRecordModeUI(transformRecorder);
                }
                else
                {
                    DrawPlaybackUI(transformRecorder);
                }
            }
        }
Example #3
0
 void DrawRecordModeUI(TransformRecorder transformRecorder)
 {
     if (transformRecorder.IsRecording())
     {
         GUI.backgroundColor = Color.red;
         if (GUILayout.Button("Stop Recording"))
         {
             transformRecorder.StopRecording();
         }
     }
     else
     {
         GUI.backgroundColor = Color.green;
         if (GUILayout.Button("Start Recording"))
         {
             transformRecorder.StartRecording();
         }
     }
 }