public void ChangeCamera(OCICamera _ociCamera, bool _active, bool _force = false) { if (_active) { if (this.ociCamera != null && this.ociCamera != _ociCamera) { this.ociCamera.SetActive(false); this.ociCamera = (OCICamera)null; } if (_ociCamera != null) { _ociCamera.SetActive(true); this.ociCamera = _ociCamera; } } else if (_force) { if (this.ociCamera != null) { this.ociCamera.SetActive(false); } _ociCamera?.SetActive(false); this.ociCamera = (OCICamera)null; } else if (this.ociCamera == _ociCamera) { _ociCamera?.SetActive(false); this.ociCamera = (OCICamera)null; } Singleton <Studio.Studio> .Instance.cameraCtrl.IsOutsideSetting = this.ociCamera != null; ((TMP_Text)this.textCamera).set_text(this.ociCamera != null ? this.ociCamera.cameraInfo.name : "-"); this._cameraSelector.SetCamera(this.ociCamera); }
public bool Deselect(OCICamera _ociCamera) { if (this.m_OCICamera != _ociCamera) { return(false); } this.ociCamera = (OCICamera)null; this.active = false; return(true); }
public static OCICamera Load( OICameraInfo _info, ObjectCtrlInfo _parent, TreeNodeObject _parentNode) { ChangeAmount _source = _info.changeAmount.Clone(); OCICamera ociCamera = AddObjectCamera.Load(_info, _parent, _parentNode, false, -1); _info.changeAmount.Copy(_source, true, true, true); return(ociCamera); }
public void DeleteCamera(OCICamera _ociCamera) { if (this.ociCamera != _ociCamera) { this._cameraSelector.Init(); } else { this.ociCamera.SetActive(false); this.ociCamera = (OCICamera)null; ((Behaviour)Singleton <Studio.Studio> .Instance.cameraCtrl).set_enabled(true); ((TMP_Text)this.textCamera).set_text("-"); this._cameraSelector.Init(); } }
public void AddCamera() { if (this.cameraCount != int.MaxValue) { ++this.cameraCount; } OCICamera ociCamera = AddObjectCamera.Add(); Singleton <UndoRedoManager> .Instance.Clear(); if (Studio.Studio.optionSystem.autoSelect && ociCamera != null) { this.m_TreeNodeCtrl.SelectSingle(ociCamera.treeNodeObject, true); } this._cameraSelector.Init(); }
public void SetCamera(OCICamera _ocic) { this.dropdown.set_value((_ocic != null ? this.listCamera.FindIndex((Predicate <OCICamera>)(c => c == _ocic)) : -1) + 1); }
public void ChangeCamera(OCICamera _ociCamera) { this.ChangeCamera(_ociCamera, this.ociCamera != _ociCamera, false); }
public static OCICamera Load( OICameraInfo _info, ObjectCtrlInfo _parent, TreeNodeObject _parentNode, bool _addInfo, int _initialPosition) { OCICamera ocic = new OCICamera(); ocic.objectInfo = (ObjectInfo)_info; GameObject gameObject = CommonLib.LoadAsset <GameObject>("studio/base/00.unity3d", "p_koi_stu_cameraicon00_00", true, string.Empty); if (Object.op_Equality((Object)gameObject, (Object)null)) { Studio.Studio.DeleteIndex(_info.dicKey); return((OCICamera)null); } gameObject.get_transform().SetParent(Singleton <Scene> .Instance.commonSpace.get_transform()); ocic.objectItem = gameObject; ocic.meshRenderer = (MeshRenderer)gameObject.GetComponent <MeshRenderer>(); GuideObject guideObject = Singleton <GuideObjectManager> .Instance.Add(gameObject.get_transform(), _info.dicKey); guideObject.isActive = false; guideObject.scaleSelect = 0.1f; guideObject.scaleRot = 0.05f; guideObject.enableScale = false; ocic.guideObject = guideObject; if (_addInfo) { Studio.Studio.AddInfo((ObjectInfo)_info, (ObjectCtrlInfo)ocic); } else { Studio.Studio.AddObjectCtrlInfo((ObjectCtrlInfo)ocic); } TreeNodeObject _parent1 = !Object.op_Inequality((Object)_parentNode, (Object)null) ? (_parent == null ? (TreeNodeObject)null : _parent.treeNodeObject) : _parentNode; TreeNodeObject treeNodeObject = Studio.Studio.AddNode(_info.name, _parent1); treeNodeObject.onVisible += new TreeNodeObject.OnVisibleFunc(((ObjectCtrlInfo)ocic).OnVisible); treeNodeObject.treeState = _info.treeState; treeNodeObject.enableVisible = true; treeNodeObject.enableAddChild = false; treeNodeObject.visible = _info.visible; treeNodeObject.baseColor = !_info.active ? AddObjectCamera.baseColor : AddObjectCamera.activeColor; treeNodeObject.colorSelect = treeNodeObject.baseColor; guideObject.guideSelect.treeNodeObject = treeNodeObject; ocic.treeNodeObject = treeNodeObject; ObservableExtensions.Subscribe <PointerEventData>((IObservable <M0>)ObservableTriggerExtensions.OnPointerClickAsObservable((UIBehaviour)treeNodeObject.buttonSelect), (Action <M0>)(_ped => { if (_ped.get_button() != 1) { return; } Singleton <Studio.Studio> .Instance.ChangeCamera(ocic); Singleton <Studio.Studio> .Instance.manipulatePanelCtrl.UpdateInfo(5); })); if (_initialPosition == 1) { _info.changeAmount.pos = Singleton <Studio.Studio> .Instance.cameraCtrl.targetPos; } _info.changeAmount.OnChange(); Studio.Studio.AddCtrlInfo((ObjectCtrlInfo)ocic); _parent?.OnLoadAttach(!Object.op_Inequality((Object)_parentNode, (Object)null) ? _parent.treeNodeObject : _parentNode, (ObjectCtrlInfo)ocic); Singleton <Studio.Studio> .Instance.ChangeCamera(ocic, _info.active, false); return(ocic); }