Example #1
0
 private void OnFocalClicked()
 {
     focalActionSelected = Selection.IsSelected(gameObject);
     if (!focalActionSelected)
     {
         Selection.AddToSelection(gameObject);
     }
     focalValueCommand = new CommandSetValue <float>("Camera Focal", "/CameraController/focal");
 }
 public override void Undo()
 {
     foreach (GameObject o in objects)
     {
         if (null == o)
         {
             continue;
         }
         Selection.AddToSelection(o);
     }
 }
Example #3
0
        private void OnCheckVideoOutput(bool value)
        {
            if (value)
            {
                Selection.Clear();
                Selection.AddToSelection(gameObject);
                selectionWasEnabled = Selection.enabled;
                Selection.enabled   = false;

                GlobalState.Animation.timeHooksEnabled = false;
                GlobalState.Animation.onFrameEvent.AddListener(OnFrameChanged);

                isVideoOutput = true;

                GlobalState.Animation.CurrentFrame = GlobalState.Animation.StartFrame;
            }

            GlobalState.Animation.OnToggleStartVideoOutput(value);
        }
Example #4
0
        void OnSnapshot()
        {
            var resolution = CameraManager.Instance.CurrentResolution;

            IEnumerator DoSnapshot()
            {
                // Wait for 2 frames (sometimes the rendering is wrong)
                yield return(null);

                yield return(new WaitForEndOfFrame());

                Snapshot = null;
                TakeSnapshot();
                Utils.SavePNG(Snapshot, System.IO.Path.Combine(GlobalState.Settings.snapshotsDirectory, GlobalState.Settings.ProjectName + "_" + System.DateTime.Now.ToString("yyyy-MM-dd_HH-mm-ss") + ".png"));
                Snapshot = null;
                CameraManager.Instance.CurrentResolution = resolution;
            }

            Selection.Clear();
            Selection.AddToSelection(gameObject);
            CameraManager.Instance.CurrentResolution = CameraManager.Instance.videoOutputResolution;
            SoundManager.Instance.PlayUISound(SoundManager.Sounds.Snapshot);
            StartCoroutine(DoSnapshot());
        }