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); } }
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); }
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()); }