예제 #1
0
        private static void StartPOV()
        {
            var ctrlInfo = Studio.Studio.GetCtrlInfo(Singleton <Studio.Studio> .Instance.treeNodeCtrl.selectNode);

            if (!(ctrlInfo is OCIChar ocichar))
            {
                return;
            }

            chara = ocichar.charInfo;

            eyes = chara.eyeLookCtrl.eyeLookScript.eyeObjs;
            if (eyes == null)
            {
                return;
            }

            head = chara.objHeadBone;
            if (head == null)
            {
                return;
            }

            if (hideHead.Value)
            {
                head.SetActive(false);
            }

            var data = cc.Export();

            backupData = data;
            backupFov  = cc.fieldOfView;

            cc.Import(new Studio.CameraControl.CameraData(data)
            {
                distance = Vector3.zero
            });
            viewRotation = Vector3.zero;

            cc.fieldOfView = fov.Value;

            toggle = true;
        }
            private static bool Studio_LoadScene(Studio.Studio __instance, string _path, ref bool __result, ref BackgroundCtrl ___m_BackgroundCtrl, ref Studio.CameraControl ___m_CameraCtrl)
            {
                if (IsStudio)
                {
                    return(true);
                }

                if (!File.Exists(_path))
                {
                    __result = false;
                    return(false);
                }
                __instance.InitScene(false);
                var sceneInfo = new SceneInfo();

                Traverse.Create(__instance).Property("sceneInfo").SetValue(sceneInfo);
                if (!sceneInfo.Load(_path))
                {
                    __result = false;
                    return(false);
                }
                LoadingScene = true;
                AddObjectAssist.LoadChild(sceneInfo.dicObject);
                ChangeAmount source = sceneInfo.caMap.Clone();

                __instance.AddMap(sceneInfo.map, false, false);
                sceneInfo.caMap.Copy(source);
                Singleton <MapCtrl> .Instance.Reflect();

                __instance.bgmCtrl.Play(__instance.bgmCtrl.no);
                __instance.envCtrl.Play(__instance.envCtrl.no);
                __instance.outsideSoundCtrl.Play(__instance.outsideSoundCtrl.fileName);
                //Add the component if it doesn't exist
                if (___m_BackgroundCtrl == null)
                {
                    ___m_BackgroundCtrl = Camera.main.gameObject.AddComponent <BackgroundCtrl>();
                }
                __instance.treeNodeCtrl.RefreshHierachy();
                if (sceneInfo.cameraSaveData != null)
                {
                    ___m_CameraCtrl.Import(sceneInfo.cameraSaveData);
                }
                __instance.cameraLightCtrl.Reflect();
                sceneInfo.dataVersion = sceneInfo.version;
                LoadingScene          = false;

                __result = true;
                return(false);
            }
예제 #3
0
        private static void StopPOV()
        {
            if (cc != null && backupData != null)
            {
                cc.Import(backupData);
                cc.fieldOfView = backupFov;
            }

            if (head != null)
            {
                head.SetActive(true);
            }

            chara      = null;
            eyes       = null;
            backupData = null;
            toggle     = false;
        }