public void Import(CameraControl.CameraData _src) { if (_src == null) { return; } this.cameraData.Copy(_src); this.fieldOfView = this.cameraData.parse; }
private static void StopPOV() { if (cc != null && backupData != null) { cc.Import(backupData); cc.fieldOfView = backupFov; } if (head != null) { head.transform.localEulerAngles = Vector3.zero; head.SetActive(true); } chara = null; eyes = null; head = null; backupData = null; toggle = false; }
private static void StartPOV() { var ctrlInfo = Studio.Studio.GetCtrlInfo(Singleton <Studio.Studio> .Instance.treeNodeCtrl.selectNode); if (!(ctrlInfo is OCIChar ocichar)) { return; } var temp = GameObject.Find("StudioScene/Camera/Main Camera"); if (temp == null) { return; } cc = temp.GetComponent <CameraControl>(); if (cc == null) { return; } chara = ocichar.charInfo; eyes = new Transform[2]; foreach (var child in chara.transform.GetComponentsInChildren <Transform>()) { if (child.name.Contains("_J_Eye_t_L")) { eyes[0] = child; } else if (child.name.Contains("_J_Eye_t_R")) { eyes[1] = child; } } if (eyes[0] == null || eyes[1] == null) { return; } head = chara.human.head.Obj; if (head == null) { return; } if (hideHead.Value) { head.SetActive(false); } var data = cc.Export(); backupData = data; backupFov = cc.fieldOfView; cc.Import(new CameraControl.CameraData(data) { distance = Vector3.zero }); rotationX = 0f; rotationY = 0f; toggle = true; }
public bool Load(string _path, out Version _dataVersion) { using (FileStream fileStream = new FileStream(_path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) { using (BinaryReader binaryReader = new BinaryReader((Stream)fileStream)) { PngFile.SkipPng(binaryReader); this.dataVersion = new Version(binaryReader.ReadString()); int num1 = binaryReader.ReadInt32(); for (int index = 0; index < num1; ++index) { int key = binaryReader.ReadInt32(); int num2 = binaryReader.ReadInt32(); ObjectInfo objectInfo = (ObjectInfo)null; switch (num2) { case 0: objectInfo = (ObjectInfo) new OICharInfo((ChaFileControl)null, -1); break; case 1: objectInfo = (ObjectInfo) new OIItemInfo(-1, -1, -1, -1); break; case 2: objectInfo = (ObjectInfo) new OILightInfo(-1, -1); break; case 3: objectInfo = (ObjectInfo) new OIFolderInfo(-1); break; case 4: objectInfo = (ObjectInfo) new OIRouteInfo(-1); break; case 5: objectInfo = (ObjectInfo) new OICameraInfo(-1); break; default: Debug.LogWarning((object)string.Format("対象外 : {0}", (object)num2)); break; } objectInfo.Load(binaryReader, this.dataVersion, false, true); this.dicObject.Add(key, objectInfo); this.hashIndex.Add(key); } this.map = binaryReader.ReadInt32(); this.caMap.Load(binaryReader); this.mapOption = binaryReader.ReadBoolean(); this.cgLookupTexture = binaryReader.ReadInt32(); this.cgBlend = binaryReader.ReadSingle(); this.cgSaturation = binaryReader.ReadInt32(); this.cgBrightness = binaryReader.ReadInt32(); this.cgContrast = binaryReader.ReadInt32(); this.enableAmbientOcclusion = binaryReader.ReadBoolean(); this.aoIntensity = binaryReader.ReadSingle(); this.aoThicknessModeifier = binaryReader.ReadSingle(); this.aoColor = (Color)JsonUtility.FromJson <Color>(binaryReader.ReadString()); this.enableBloom = binaryReader.ReadBoolean(); this.bloomIntensity = binaryReader.ReadSingle(); this.bloomThreshold = binaryReader.ReadSingle(); this.bloomSoftKnee = binaryReader.ReadSingle(); this.bloomClamp = binaryReader.ReadBoolean(); this.bloomDiffusion = binaryReader.ReadSingle(); this.bloomColor = (Color)JsonUtility.FromJson <Color>(binaryReader.ReadString()); this.enableDepth = binaryReader.ReadBoolean(); this.depthForcus = binaryReader.ReadInt32(); this.depthFocalSize = binaryReader.ReadSingle(); this.depthAperture = binaryReader.ReadSingle(); this.enableVignette = binaryReader.ReadBoolean(); this.enableSSR = binaryReader.ReadBoolean(); this.enableReflectionProbe = binaryReader.ReadBoolean(); this.reflectionProbeCubemap = binaryReader.ReadInt32(); this.reflectionProbeIntensity = binaryReader.ReadSingle(); this.enableFog = binaryReader.ReadBoolean(); this.fogExcludeFarPixels = binaryReader.ReadBoolean(); this.fogHeight = binaryReader.ReadSingle(); this.fogHeightDensity = binaryReader.ReadSingle(); this.fogColor = (Color)JsonUtility.FromJson <Color>(binaryReader.ReadString()); this.fogDensity = binaryReader.ReadSingle(); this.enableSunShafts = binaryReader.ReadBoolean(); this.sunCaster = binaryReader.ReadInt32(); this.sunThresholdColor = (Color)JsonUtility.FromJson <Color>(binaryReader.ReadString()); this.sunColor = (Color)JsonUtility.FromJson <Color>(binaryReader.ReadString()); this.sunDistanceFallOff = binaryReader.ReadSingle(); this.sunBlurSize = binaryReader.ReadSingle(); this.sunIntensity = binaryReader.ReadSingle(); this.enableShadow = binaryReader.ReadBoolean(); this.environmentLightingSkyColor = (Color)JsonUtility.FromJson <Color>(binaryReader.ReadString()); this.environmentLightingEquatorColor = (Color)JsonUtility.FromJson <Color>(binaryReader.ReadString()); this.environmentLightingGroundColor = (Color)JsonUtility.FromJson <Color>(binaryReader.ReadString()); if (this.cameraSaveData == null) { this.cameraSaveData = new CameraControl.CameraData(); } this.cameraSaveData.Load(binaryReader); for (int index = 0; index < 10; ++index) { CameraControl.CameraData cameraData = new CameraControl.CameraData(); cameraData.Load(binaryReader); this.cameraData[index] = cameraData; } this.charaLight.Load(binaryReader, this.dataVersion); this.mapLight.Load(binaryReader, this.dataVersion); this.bgmCtrl.Load(binaryReader, this.dataVersion); this.envCtrl.Load(binaryReader, this.dataVersion); this.outsideSoundCtrl.Load(binaryReader, this.dataVersion); this.background = binaryReader.ReadString(); this.frame = binaryReader.ReadString(); _dataVersion = this.dataVersion; } } return(true); }
public void Init() { this.dicObject.Clear(); this.map = -1; this.caMap.Reset(); this.mapOption = true; this.cgLookupTexture = ScreenEffectDefine.ColorGradingLookupTexture; this.cgBlend = ScreenEffectDefine.ColorGradingBlend; this.cgSaturation = ScreenEffectDefine.ColorGradingSaturation; this.cgBrightness = ScreenEffectDefine.ColorGradingBrightness; this.cgContrast = ScreenEffectDefine.ColorGradingContrast; this.enableAmbientOcclusion = ScreenEffectDefine.AmbientOcclusion; this.aoIntensity = ScreenEffectDefine.AmbientOcclusionIntensity; this.aoThicknessModeifier = ScreenEffectDefine.AmbientOcclusionThicknessModeifier; this.aoColor = ScreenEffectDefine.AmbientOcclusionColor; this.enableBloom = ScreenEffectDefine.Bloom; this.bloomIntensity = ScreenEffectDefine.BloomIntensity; this.bloomThreshold = ScreenEffectDefine.BloomThreshold; this.bloomSoftKnee = ScreenEffectDefine.BloomSoftKnee; this.bloomClamp = ScreenEffectDefine.BloomClamp; this.bloomDiffusion = ScreenEffectDefine.BloomDiffusion; this.bloomColor = ScreenEffectDefine.BloomColor; this.enableDepth = ScreenEffectDefine.DepthOfField; this.depthForcus = ScreenEffectDefine.DepthOfFieldForcus; this.depthFocalSize = ScreenEffectDefine.DepthOfFieldFocalSize; this.depthAperture = ScreenEffectDefine.DepthOfFieldAperture; this.enableVignette = ScreenEffectDefine.Vignette; this.enableSSR = ScreenEffectDefine.ScreenSpaceReflections; this.enableReflectionProbe = ScreenEffectDefine.ReflectionProbe; this.reflectionProbeCubemap = ScreenEffectDefine.ReflectionProbeCubemap; this.reflectionProbeIntensity = ScreenEffectDefine.ReflectionProbeIntensity; this.enableFog = ScreenEffectDefine.Fog; this.fogExcludeFarPixels = ScreenEffectDefine.FogExcludeFarPixels; this.fogHeight = ScreenEffectDefine.FogHeight; this.fogHeightDensity = ScreenEffectDefine.FogHeightDensity; this.fogColor = ScreenEffectDefine.FogColor; this.fogDensity = ScreenEffectDefine.FogDensity; this.enableSunShafts = ScreenEffectDefine.SunShaft; this.sunCaster = ScreenEffectDefine.SunShaftCaster; this.sunThresholdColor = ScreenEffectDefine.SunShaftThresholdColor; this.sunColor = ScreenEffectDefine.SunShaftShaftsColor; this.sunDistanceFallOff = ScreenEffectDefine.SunShaftDistanceFallOff; this.sunBlurSize = ScreenEffectDefine.SunShaftBlurSize; this.sunIntensity = ScreenEffectDefine.SunShaftIntensity; this.enableShadow = true; this.environmentLightingSkyColor = ScreenEffectDefine.EnvironmentLightingSkyColor; this.environmentLightingEquatorColor = ScreenEffectDefine.EnvironmentLightingEquatorColor; this.environmentLightingGroundColor = ScreenEffectDefine.EnvironmentLightingGroundColor; this.cameraSaveData = (CameraControl.CameraData)null; this.cameraData = new CameraControl.CameraData[10]; if (Singleton <Studio.Studio> .IsInstance()) { for (int index = 0; index < 10; ++index) { this.cameraData[index] = Singleton <Studio.Studio> .Instance.cameraCtrl.ExportResetData(); } } this.charaLight.Init(); this.mapLight.Init(); this.bgmCtrl.play = false; this.bgmCtrl.repeat = BGMCtrl.Repeat.All; this.bgmCtrl.no = 0; this.envCtrl.play = false; this.envCtrl.repeat = BGMCtrl.Repeat.All; this.envCtrl.no = 0; this.outsideSoundCtrl.play = false; this.outsideSoundCtrl.repeat = BGMCtrl.Repeat.All; this.outsideSoundCtrl.fileName = string.Empty; this.background = string.Empty; this.frame = string.Empty; this.hashIndex.Clear(); this.lightCount = 0; this.dataVersion = this.m_Version; }