Exemplo n.º 1
0
        public void MakeCameraScreenshots()
        {
            Camera mainCamera = Camera.main;

            if (mainCamera != null)
            {
                string folderPath = EditorUtility.SaveFolderPanel("CaronteFX - Select Folder", "", "");
                if (folderPath != string.Empty)
                {
                    EditorApplication.isPlaying = true;

                    GameObject go = mainCamera.gameObject;
                    EditorGUIUtility.PingObject(go);

                    CarCameraCapturer cameraCapturer = go.GetComponent <CarCameraCapturer>();
                    if (cameraCapturer == null)
                    {
                        cameraCapturer = Undo.AddComponent <CarCameraCapturer>(go);
                    }

                    Undo.RecordObject(go, "Change camera capturer ");

                    cameraCapturer.enabled     = true;
                    cameraCapturer.cranimation = crAnimation_;
                    cameraCapturer.folder      = folderPath;

                    Undo.CollapseUndoOperations(Undo.GetCurrentGroup());
                }
            }
        }
Exemplo n.º 2
0
        public void RemoveCameraRecorder()
        {
            Camera mainCamera = Camera.main;

            if (mainCamera != null)
            {
                GameObject        go             = mainCamera.gameObject;
                CarCameraCapturer cameraCapturer = go.GetComponent <CarCameraCapturer>();
                if (cameraCapturer != null)
                {
                    Undo.DestroyObjectImmediate(cameraCapturer);
                    EditorGUIUtility.PingObject(go);
                }
            }
        }
Exemplo n.º 3
0
 void OnEnable()
 {
     capturer_ = (CarCameraCapturer)target;
 }