1
0
mirror of https://github.com/xiaopeng12138/MaiDXR.git synced 2024-11-30 13:44:28 +01:00

Update NoneVRSettingManager

This commit is contained in:
xpeng 2022-08-17 23:15:59 +02:00
parent 0bcff382dd
commit 8c58b00ae5
6 changed files with 210 additions and 58 deletions

View File

@ -316,7 +316,7 @@ MonoBehaviour:
m_Placeholder: {fileID: 0} m_Placeholder: {fileID: 0}
m_ItemText: {fileID: 1016472457} m_ItemText: {fileID: 1016472457}
m_ItemImage: {fileID: 0} m_ItemImage: {fileID: 0}
m_Value: 3 m_Value: 2
m_Options: m_Options:
m_Options: m_Options:
- m_Text: 30 - m_Text: 30
@ -1370,7 +1370,7 @@ GameObject:
- component: {fileID: 357334432} - component: {fileID: 357334432}
- component: {fileID: 357334436} - component: {fileID: 357334436}
m_Layer: 0 m_Layer: 0
m_Name: 3rdPersonCamera m_Name: NVRCamera
m_TagString: Untagged m_TagString: Untagged
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
m_NavMeshLayer: 0 m_NavMeshLayer: 0
@ -1434,7 +1434,7 @@ Camera:
height: 1 height: 1
near clip plane: 0.2 near clip plane: 0.2
far clip plane: 5 far clip plane: 5
field of view: 60 field of view: 65
orthographic: 0 orthographic: 0
orthographic size: 5 orthographic size: 5
m_Depth: 1 m_Depth: 1
@ -1459,13 +1459,13 @@ Transform:
m_PrefabInstance: {fileID: 0} m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 357334431} m_GameObject: {fileID: 357334431}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalRotation: {x: 0.28006452, y: 0.40193385, z: -0.13059622, w: 0.86195}
m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalPosition: {x: -1.137, y: 1.998, z: 0.2993}
m_LocalScale: {x: 10, y: 10, z: 10} m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: [] m_Children: []
m_Father: {fileID: 1585482469} m_Father: {fileID: 0}
m_RootOrder: 0 m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 36, y: 50, z: 0} m_LocalEulerAnglesHint: {x: 36, y: 50, z: 0}
--- !u!114 &357334436 --- !u!114 &357334436
MonoBehaviour: MonoBehaviour:
@ -1479,8 +1479,8 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 05a77fb6315a47e44a6824affd415238, type: 3} m_Script: {fileID: 11500000, guid: 05a77fb6315a47e44a6824affd415238, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
target: {fileID: 1249534342} target: {fileID: 0}
smoothSpeed: 0 smoothSpeed: 0.1
PositionOffset: {x: 0, y: 0, z: 0} PositionOffset: {x: 0, y: 0, z: 0}
FPS: 60 FPS: 60
--- !u!1 &358458036 --- !u!1 &358458036
@ -3433,7 +3433,7 @@ Transform:
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: [] m_Children: []
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 8 m_RootOrder: 9
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &595031216 --- !u!114 &595031216
MonoBehaviour: MonoBehaviour:
@ -4005,7 +4005,7 @@ PrefabInstance:
- target: {fileID: -8679921383154817045, guid: 4cbf0dbca1ca1a5499c4b7806ab6aac5, - target: {fileID: -8679921383154817045, guid: 4cbf0dbca1ca1a5499c4b7806ab6aac5,
type: 3} type: 3}
propertyPath: m_RootOrder propertyPath: m_RootOrder
value: 3 value: 4
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 4cbf0dbca1ca1a5499c4b7806ab6aac5, - target: {fileID: -8679921383154817045, guid: 4cbf0dbca1ca1a5499c4b7806ab6aac5,
type: 3} type: 3}
@ -4090,7 +4090,7 @@ PrefabInstance:
- target: {fileID: -8256158229178198027, guid: 4cbf0dbca1ca1a5499c4b7806ab6aac5, - target: {fileID: -8256158229178198027, guid: 4cbf0dbca1ca1a5499c4b7806ab6aac5,
type: 3} type: 3}
propertyPath: m_Lightmapping propertyPath: m_Lightmapping
value: 1 value: 2
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: -8256158229178198027, guid: 4cbf0dbca1ca1a5499c4b7806ab6aac5, - target: {fileID: -8256158229178198027, guid: 4cbf0dbca1ca1a5499c4b7806ab6aac5,
type: 3} type: 3}
@ -4162,6 +4162,11 @@ PrefabInstance:
propertyPath: m_Color.r propertyPath: m_Color.r
value: 0.75849056 value: 0.75849056
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: -7502872840139380679, guid: 4cbf0dbca1ca1a5499c4b7806ab6aac5,
type: 3}
propertyPath: m_Enabled
value: 1
objectReference: {fileID: 0}
- target: {fileID: -7502872840139380679, guid: 4cbf0dbca1ca1a5499c4b7806ab6aac5, - target: {fileID: -7502872840139380679, guid: 4cbf0dbca1ca1a5499c4b7806ab6aac5,
type: 3} type: 3}
propertyPath: m_Intensity propertyPath: m_Intensity
@ -4172,6 +4177,11 @@ PrefabInstance:
propertyPath: m_SpotAngle propertyPath: m_SpotAngle
value: 178.99998 value: 178.99998
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: -7502872840139380679, guid: 4cbf0dbca1ca1a5499c4b7806ab6aac5,
type: 3}
propertyPath: m_Lightmapping
value: 4
objectReference: {fileID: 0}
- target: {fileID: -7502872840139380679, guid: 4cbf0dbca1ca1a5499c4b7806ab6aac5, - target: {fileID: -7502872840139380679, guid: 4cbf0dbca1ca1a5499c4b7806ab6aac5,
type: 3} type: 3}
propertyPath: m_InnerSpotAngle propertyPath: m_InnerSpotAngle
@ -8296,7 +8306,7 @@ Camera:
width: 1 width: 1
height: 1 height: 1
near clip plane: 0.01 near clip plane: 0.01
far clip plane: 1000 far clip plane: 10
field of view: 60 field of view: 60
orthographic: 0 orthographic: 0
orthographic size: 5 orthographic size: 5
@ -8861,7 +8871,7 @@ MonoBehaviour:
m_OnCullStateChanged: m_OnCullStateChanged:
m_PersistentCalls: m_PersistentCalls:
m_Calls: [] m_Calls: []
m_text: None m_text: BitBlt
m_isRightToLeft: 0 m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
@ -8948,7 +8958,7 @@ PrefabInstance:
- target: {fileID: -8679921383154817045, guid: 4557494e9d4b8ab47b2842d4bf045f25, - target: {fileID: -8679921383154817045, guid: 4557494e9d4b8ab47b2842d4bf045f25,
type: 3} type: 3}
propertyPath: m_RootOrder propertyPath: m_RootOrder
value: 5 value: 6
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 4557494e9d4b8ab47b2842d4bf045f25, - target: {fileID: -8679921383154817045, guid: 4557494e9d4b8ab47b2842d4bf045f25,
type: 3} type: 3}
@ -9397,6 +9407,7 @@ GameObject:
- component: {fileID: 1365934246} - component: {fileID: 1365934246}
- component: {fileID: 1365934245} - component: {fileID: 1365934245}
- component: {fileID: 1365934244} - component: {fileID: 1365934244}
- component: {fileID: 1365934247}
m_Layer: 5 m_Layer: 5
m_Name: NVRFPSDropdown m_Name: NVRFPSDropdown
m_TagString: Untagged m_TagString: Untagged
@ -9493,7 +9504,19 @@ MonoBehaviour:
m_Image: {fileID: 0} m_Image: {fileID: 0}
m_OnValueChanged: m_OnValueChanged:
m_PersistentCalls: m_PersistentCalls:
m_Calls: [] m_Calls:
- m_Target: {fileID: 1365934247}
m_TargetAssemblyTypeName: NoneVRSettingManager, Assembly-CSharp
m_MethodName: SetNVRFPS
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 1
m_AlphaFadeSpeed: 0.15 m_AlphaFadeSpeed: 0.15
--- !u!114 &1365934245 --- !u!114 &1365934245
MonoBehaviour: MonoBehaviour:
@ -9533,6 +9556,22 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1365934242} m_GameObject: {fileID: 1365934242}
m_CullTransparentMesh: 1 m_CullTransparentMesh: 1
--- !u!114 &1365934247
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1365934242}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: ba1888887182d434fbccfdab834b0fc2, type: 3}
m_Name:
m_EditorClassIdentifier:
NVRCameraObj: {fileID: 357334431}
NVRCamera: {fileID: 357334434}
NVRCameraTargetFP: {fileID: 1249534342}
NVRCameraTargetTP: {fileID: 1585482469}
--- !u!1 &1378887735 --- !u!1 &1378887735
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -10272,7 +10311,7 @@ MonoBehaviour:
m_Placeholder: {fileID: 0} m_Placeholder: {fileID: 0}
m_ItemText: {fileID: 1457747674} m_ItemText: {fileID: 1457747674}
m_ItemImage: {fileID: 0} m_ItemImage: {fileID: 0}
m_Value: 0 m_Value: 2
m_Options: m_Options:
m_Options: m_Options:
- m_Text: None - m_Text: None
@ -11326,7 +11365,7 @@ RectTransform:
- {fileID: 1266541163} - {fileID: 1266541163}
- {fileID: 418365313} - {fileID: 418365313}
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 6 m_RootOrder: 7
m_LocalEulerAnglesHint: {x: -45, y: 0, z: 0} m_LocalEulerAnglesHint: {x: -45, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0} m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0}
@ -11493,8 +11532,9 @@ GameObject:
- component: {fileID: 1585482474} - component: {fileID: 1585482474}
- component: {fileID: 1585482473} - component: {fileID: 1585482473}
- component: {fileID: 1585482472} - component: {fileID: 1585482472}
- component: {fileID: 1585482475}
m_Layer: 6 m_Layer: 6
m_Name: 3rdPersonCameraCube m_Name: TPCameraCube
m_TagString: Untagged m_TagString: Untagged
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
m_NavMeshLayer: 0 m_NavMeshLayer: 0
@ -11511,8 +11551,7 @@ Transform:
m_LocalPosition: {x: -1.137, y: 1.998, z: 0.2993} m_LocalPosition: {x: -1.137, y: 1.998, z: 0.2993}
m_LocalScale: {x: 0.1, y: 0.1, z: 0.10000001} m_LocalScale: {x: 0.1, y: 0.1, z: 0.10000001}
m_ConstrainProportionsScale: 1 m_ConstrainProportionsScale: 1
m_Children: m_Children: []
- {fileID: 357334435}
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 2 m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@ -11611,7 +11650,19 @@ MonoBehaviour:
m_Calls: [] m_Calls: []
m_SelectExited: m_SelectExited:
m_PersistentCalls: m_PersistentCalls:
m_Calls: [] m_Calls:
- m_Target: {fileID: 1585482475}
m_TargetAssemblyTypeName: NoneVRSettingManager, Assembly-CSharp
m_MethodName: SetTPCamTransform
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 1
m_Activated: m_Activated:
m_PersistentCalls: m_PersistentCalls:
m_Calls: [] m_Calls: []
@ -11715,6 +11766,22 @@ BoxCollider:
serializedVersion: 2 serializedVersion: 2
m_Size: {x: 1.0000002, y: 1, z: 1} m_Size: {x: 1.0000002, y: 1, z: 1}
m_Center: {x: 0, y: -0.0000009536743, z: 0} m_Center: {x: 0, y: -0.0000009536743, z: 0}
--- !u!114 &1585482475
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1585482468}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: ba1888887182d434fbccfdab834b0fc2, type: 3}
m_Name:
m_EditorClassIdentifier:
NVRCameraObj: {fileID: 0}
NVRCamera: {fileID: 0}
NVRCameraTargetFP: {fileID: 0}
NVRCameraTargetTP: {fileID: 0}
--- !u!1 &1612026918 stripped --- !u!1 &1612026918 stripped
GameObject: GameObject:
m_CorrespondingSourceObject: {fileID: 5048151436394606877, guid: 4cbf0dbca1ca1a5499c4b7806ab6aac5, m_CorrespondingSourceObject: {fileID: 5048151436394606877, guid: 4cbf0dbca1ca1a5499c4b7806ab6aac5,
@ -11892,7 +11959,7 @@ Transform:
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: [] m_Children: []
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 4 m_RootOrder: 5
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1634811399 stripped --- !u!1 &1634811399 stripped
GameObject: GameObject:
@ -12618,6 +12685,7 @@ GameObject:
m_Component: m_Component:
- component: {fileID: 1780461005} - component: {fileID: 1780461005}
- component: {fileID: 1780461006} - component: {fileID: 1780461006}
- component: {fileID: 1780461007}
m_Layer: 5 m_Layer: 5
m_Name: NVRFOV m_Name: NVRFOV
m_TagString: Untagged m_TagString: Untagged
@ -12698,7 +12766,35 @@ MonoBehaviour:
m_Value: 65 m_Value: 65
m_OnValueChanged: m_OnValueChanged:
m_PersistentCalls: m_PersistentCalls:
m_Calls: [] m_Calls:
- m_Target: {fileID: 1780461007}
m_TargetAssemblyTypeName: NoneVRSettingManager, Assembly-CSharp
m_MethodName: SetNVRFOV
m_Mode: 0
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 1
--- !u!114 &1780461007
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1780461004}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: ba1888887182d434fbccfdab834b0fc2, type: 3}
m_Name:
m_EditorClassIdentifier:
NVRCameraObj: {fileID: 357334431}
NVRCamera: {fileID: 357334434}
NVRCameraTargetFP: {fileID: 1249534342}
NVRCameraTargetTP: {fileID: 1585482469}
--- !u!1 &1793844388 --- !u!1 &1793844388
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -12783,7 +12879,7 @@ Transform:
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: [] m_Children: []
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 7 m_RootOrder: 8
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &1793933669 --- !u!114 &1793933669
MonoBehaviour: MonoBehaviour:
@ -12988,6 +13084,7 @@ GameObject:
- component: {fileID: 1880181386} - component: {fileID: 1880181386}
- component: {fileID: 1880181385} - component: {fileID: 1880181385}
- component: {fileID: 1880181384} - component: {fileID: 1880181384}
- component: {fileID: 1880181387}
m_Layer: 5 m_Layer: 5
m_Name: NVRModeDropdown m_Name: NVRModeDropdown
m_TagString: Untagged m_TagString: Untagged
@ -13076,7 +13173,19 @@ MonoBehaviour:
m_Image: {fileID: 0} m_Image: {fileID: 0}
m_OnValueChanged: m_OnValueChanged:
m_PersistentCalls: m_PersistentCalls:
m_Calls: [] m_Calls:
- m_Target: {fileID: 1880181387}
m_TargetAssemblyTypeName: NoneVRSettingManager, Assembly-CSharp
m_MethodName: SetNVRMode
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 1
m_AlphaFadeSpeed: 0.15 m_AlphaFadeSpeed: 0.15
--- !u!114 &1880181385 --- !u!114 &1880181385
MonoBehaviour: MonoBehaviour:
@ -13116,6 +13225,22 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1880181382} m_GameObject: {fileID: 1880181382}
m_CullTransparentMesh: 1 m_CullTransparentMesh: 1
--- !u!114 &1880181387
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1880181382}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: ba1888887182d434fbccfdab834b0fc2, type: 3}
m_Name:
m_EditorClassIdentifier:
NVRCameraObj: {fileID: 357334431}
NVRCamera: {fileID: 357334434}
NVRCameraTargetFP: {fileID: 1249534342}
NVRCameraTargetTP: {fileID: 1585482469}
--- !u!1 &1892076584 --- !u!1 &1892076584
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -13478,7 +13603,7 @@ MonoBehaviour:
m_OnCullStateChanged: m_OnCullStateChanged:
m_PersistentCalls: m_PersistentCalls:
m_Calls: [] m_Calls: []
m_text: 120 m_text: 90
m_isRightToLeft: 0 m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
@ -14552,7 +14677,7 @@ Transform:
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: [] m_Children: []
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 9 m_RootOrder: 10
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &2132224331 --- !u!114 &2132224331
MonoBehaviour: MonoBehaviour:

View File

@ -3,7 +3,7 @@ using UnityEngine;
public class CameraSmooth : MonoBehaviour { public class CameraSmooth : MonoBehaviour {
public Transform target; public Transform target;
public float smoothSpeed = 0.125f; public float smoothSpeed = 0.1f;
public Vector3 PositionOffset; public Vector3 PositionOffset;
public int FPS = 60; public int FPS = 60;
float elapsed; float elapsed;

View File

@ -75,6 +75,12 @@ public static class JsonConfig {
config[key] = JArray.FromObject(numbers); config[key] = JArray.FromObject(numbers);
saveFile(); saveFile();
} }
public static void SetVector3(string key, Vector3 vector) {
SetFloatArray(key, new float[] { vector.x, vector.y, vector.z });
}
public static void SetQuaternion(string key, Quaternion quaternion) {
SetFloatArray(key, new float[] { quaternion.x, quaternion.y, quaternion.z, quaternion.w });
}
public static bool GetBoolean(string key) { public static bool GetBoolean(string key) {
ensureInitialization(); ensureInitialization();
@ -96,4 +102,10 @@ public static class JsonConfig {
ensureInitialization(); ensureInitialization();
return config.Value<JArray>(key).ToObject<float[]>(); return config.Value<JArray>(key).ToObject<float[]>();
} }
public static Vector3 GetVector3(string key) {
return new Vector3(GetFloatArray(key)[0], GetFloatArray(key)[1], GetFloatArray(key)[2]);
}
public static Quaternion GetQuaternion(string key) {
return new Quaternion(GetFloatArray(key)[0], GetFloatArray(key)[1], GetFloatArray(key)[2], GetFloatArray(key)[3]);
}
} }

View File

@ -4,29 +4,32 @@ using UnityEngine.UI;
public class NoneVRSettingManager : MonoBehaviour public class NoneVRSettingManager : MonoBehaviour
{ {
public Camera FPCamera; public GameObject NVRCameraObj;
public Camera TPCamera; public Camera NVRCamera;
private CameraSmooth CameraSmooth; public Transform NVRCameraTargetFP;
public Transform NVRCameraTargetTP;
public CameraSmooth CameraSmooth;
private TMP_Dropdown Dropdown; private TMP_Dropdown Dropdown;
private Slider Slider; private Slider Slider;
void Start() void Start()
{ {
CameraSmooth = FPCamera.GetComponent<CameraSmooth>();
Dropdown = GetComponent<TMP_Dropdown>(); Dropdown = GetComponent<TMP_Dropdown>();
Slider = GetComponent<Slider>(); Slider = GetComponent<Slider>();
switch (gameObject.name) switch (gameObject.name)
{ {
case "NVRModeDropdown": case "NVRModeDropdown":
GetNVRMode();
break; break;
case "NVRFOV": case "NVRFOV":
GetNVRFOV();
break; break;
case "NVRFPSDropdown": case "NVRFPSDropdown":
GetNVRFPS();
break;
case "TPCameraCube":
GetTPCamTransform();
break; break;
} }
} }
public void GetNVRMode() public void GetNVRMode()
@ -39,13 +42,22 @@ public class NoneVRSettingManager : MonoBehaviour
{ {
if (JsonConfig.HasKey("NVRFOV")) if (JsonConfig.HasKey("NVRFOV"))
Slider.value = (float)JsonConfig.GetDouble("NVRFOV"); Slider.value = (float)JsonConfig.GetDouble("NVRFOV");
SetNVRFOV(); SetNVRFOV(Slider.value);
} }
public void GetNVRFPSDropdown() public void GetNVRFPS()
{ {
if (JsonConfig.HasKey("NVRFPS")) if (JsonConfig.HasKey("NVRFPS"))
Dropdown.value = JsonConfig.GetInt("NVRFPS"); Dropdown.value = JsonConfig.GetInt("NVRFPS");
SetNVRFPSDropdown(); SetNVRFPS();
}
public void GetTPCamTransform()
{
if (JsonConfig.HasKey("TPCamPosition"))
gameObject.transform.position = JsonConfig.GetVector3("TPCamPosition");
if (JsonConfig.HasKey("TPCamRotation"))
gameObject.transform.rotation = JsonConfig.GetQuaternion("TPCamRotation");
SetTPCamTransform();
} }
public void SetNVRMode() public void SetNVRMode()
@ -53,27 +65,25 @@ public class NoneVRSettingManager : MonoBehaviour
switch (Dropdown.value) switch (Dropdown.value)
{ {
case 0: case 0:
FPCamera.enabled = false; NVRCameraObj.SetActive(false);
TPCamera.enabled = false;
break; break;
case 1: case 1:
FPCamera.enabled = true; NVRCameraObj.SetActive(true);
TPCamera.enabled = false; CameraSmooth.target = NVRCameraTargetFP;
break; break;
case 2: case 2:
FPCamera.enabled = false; NVRCameraObj.SetActive(true);
TPCamera.enabled = true; CameraSmooth.target = NVRCameraTargetTP;
break; break;
} }
JsonConfig.SetInt("NVRMode", Dropdown.value); JsonConfig.SetInt("NVRMode", Dropdown.value);
} }
public void SetNVRFOV() public void SetNVRFOV(float fov)
{ {
FPCamera.fieldOfView = Slider.value; NVRCamera.fieldOfView = fov;
TPCamera.fieldOfView = Slider.value; JsonConfig.SetDouble("NVRFOV", fov);
JsonConfig.SetDouble("NVRFOV", Slider.value);
} }
public void SetNVRFPSDropdown() public void SetNVRFPS()
{ {
switch (Dropdown.value) switch (Dropdown.value)
{ {
@ -101,4 +111,9 @@ public class NoneVRSettingManager : MonoBehaviour
} }
JsonConfig.SetInt("NVRFPS", Dropdown.value); JsonConfig.SetInt("NVRFPS", Dropdown.value);
} }
public void SetTPCamTransform()
{
JsonConfig.SetVector3("TPCamPosition", gameObject.transform.position);
JsonConfig.SetQuaternion("TPCamRotation", gameObject.transform.rotation);
}
} }

View File

@ -33,7 +33,7 @@ MonoBehaviour:
m_MainLightRenderingMode: 0 m_MainLightRenderingMode: 0
m_MainLightShadowsSupported: 0 m_MainLightShadowsSupported: 0
m_MainLightShadowmapResolution: 1024 m_MainLightShadowmapResolution: 1024
m_AdditionalLightsRenderingMode: 2 m_AdditionalLightsRenderingMode: 1
m_AdditionalLightsPerObjectLimit: 0 m_AdditionalLightsPerObjectLimit: 0
m_AdditionalLightShadowsSupported: 0 m_AdditionalLightShadowsSupported: 0
m_AdditionalLightsShadowmapResolution: 512 m_AdditionalLightsShadowmapResolution: 512

View File

@ -49,7 +49,7 @@ PlayerSettings:
m_StereoRenderingPath: 0 m_StereoRenderingPath: 0
m_ActiveColorSpace: 1 m_ActiveColorSpace: 1
m_MTRendering: 1 m_MTRendering: 1
mipStripping: 0 mipStripping: 1
numberOfMipsStripped: 0 numberOfMipsStripped: 0
m_StackTraceTypes: 010000000100000001000000010000000100000001000000 m_StackTraceTypes: 010000000100000001000000010000000100000001000000
iosShowActivityIndicatorOnLoading: -1 iosShowActivityIndicatorOnLoading: -1
@ -85,7 +85,7 @@ PlayerSettings:
hideHomeButton: 0 hideHomeButton: 0
submitAnalytics: 1 submitAnalytics: 1
usePlayerLog: 1 usePlayerLog: 1
bakeCollisionMeshes: 0 bakeCollisionMeshes: 1
forceSingleInstance: 1 forceSingleInstance: 1
useFlipModelSwapchain: 1 useFlipModelSwapchain: 1
resizableWindow: 1 resizableWindow: 1
@ -180,8 +180,8 @@ PlayerSettings:
ForceSDCardPermission: 0 ForceSDCardPermission: 0
CreateWallpaper: 0 CreateWallpaper: 0
APKExpansionFiles: 0 APKExpansionFiles: 0
keepLoadedShadersAlive: 0 keepLoadedShadersAlive: 1
StripUnusedMeshComponents: 0 StripUnusedMeshComponents: 1
VertexChannelCompressionMask: 4054 VertexChannelCompressionMask: 4054
iPhoneSdkVersion: 988 iPhoneSdkVersion: 988
iOSTargetOSVersionString: 11.0 iOSTargetOSVersionString: 11.0
@ -532,7 +532,7 @@ PlayerSettings:
tvOS: 1 tvOS: 1
m_BuildTargetGroupLightmapEncodingQuality: m_BuildTargetGroupLightmapEncodingQuality:
- m_BuildTarget: Standalone - m_BuildTarget: Standalone
m_EncodingQuality: 2 m_EncodingQuality: 1
m_BuildTargetGroupLightmapSettings: m_BuildTargetGroupLightmapSettings:
- m_BuildTarget: Standalone - m_BuildTarget: Standalone
m_TextureStreamingEnabled: 1 m_TextureStreamingEnabled: 1