1
0
mirror of synced 2025-01-18 15:24:04 +01:00

Add Hand Configs and change hand ball color

This commit is contained in:
xpeng 2022-06-09 21:36:15 +02:00
parent 0820628838
commit 406cbc19f1
8 changed files with 168 additions and 21 deletions

View File

@ -124,8 +124,8 @@ Material:
- _WorkflowMode: 1
- _ZWrite: 0
m_Colors:
- _BaseColor: {r: 0.7735849, g: 0.09122456, b: 0.09122456, a: 1}
- _Color: {r: 0.7735849, g: 0.09122453, b: 0.09122453, a: 1}
- _BaseColor: {r: 1, g: 0.25187197, b: 0.22075468, a: 1}
- _Color: {r: 1, g: 0.2518719, b: 0.22075465, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
m_BuildTextureStacks: []

View File

@ -140,10 +140,10 @@ Material:
- _WorkflowMode: 1
- _ZWrite: 0
m_Colors:
- _BaseColor: {r: 0.10441574, g: 0.09019602, b: 0.77254903, a: 1}
- _BaseColor: {r: 0.2906372, g: 0.64758795, b: 0.9811321, a: 1}
- _BaseColorAddSubDiff: {r: 0, g: 0, b: 0, a: 0}
- _CameraFadeParams: {r: 0, g: Infinity, b: 0, a: 0}
- _Color: {r: 0.10441571, g: 0.09019599, b: 0.77254903, a: 1}
- _Color: {r: 0.29063717, g: 0.64758795, b: 0.9811321, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _SoftParticleFadeParams: {r: 0, g: 0, b: 0, a: 0}
- _SpecColor: {r: 0.19999993, g: 0.19999993, b: 0.19999993, a: 1}

View File

@ -1527,7 +1527,7 @@ Transform:
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 6
m_RootOrder: 10
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!65 &90549604
BoxCollider:
@ -10258,7 +10258,7 @@ Transform:
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 5
m_RootOrder: 8
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &910165458
MonoBehaviour:
@ -12348,7 +12348,7 @@ PrefabInstance:
- target: {fileID: -8679921383154817045, guid: 31f0c3f4ace06884a8eb57730c1e9c57,
type: 3}
propertyPath: m_RootOrder
value: 4
value: 5
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 31f0c3f4ace06884a8eb57730c1e9c57,
type: 3}
@ -13977,7 +13977,7 @@ Transform:
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 10
m_RootOrder: 9
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1256711831
GameObject:
@ -17195,7 +17195,7 @@ Transform:
- {fileID: 567364759}
- {fileID: 25651915}
m_Father: {fileID: 0}
m_RootOrder: 8
m_RootOrder: 6
m_LocalEulerAnglesHint: {x: 0, y: -27.917, z: 0}
--- !u!1 &1681660568 stripped
GameObject:
@ -17857,7 +17857,7 @@ Transform:
m_Children:
- {fileID: 1688695918}
m_Father: {fileID: 0}
m_RootOrder: 9
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 7.278, y: 21.625, z: 0.272}
--- !u!65 &1744786996
BoxCollider:
@ -18293,7 +18293,7 @@ PrefabInstance:
- target: {fileID: -8679921383154817045, guid: cf8684b3c4f47b94aa7cb23ce498caf3,
type: 3}
propertyPath: m_RootOrder
value: 3
value: 4
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: cf8684b3c4f47b94aa7cb23ce498caf3,
type: 3}
@ -27631,6 +27631,59 @@ MeshRenderer:
m_SortingLayer: 0
m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!1 &1838584517
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1838584519}
- component: {fileID: 1838584518}
m_Layer: 0
m_Name: SettingsManager
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &1838584518
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1838584517}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a76604ac77e1add42b84974256adc28e, type: 3}
m_Name:
m_EditorClassIdentifier:
DefaultPhysicFPS: 90
DefaultHandSize: 8
DefaultHandPosition:
- 2
- -2
- 7
Display: {fileID: 129013443}
LHand: {fileID: 918186758}
RHand: {fileID: 587127949}
--- !u!4 &1838584519
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1838584517}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0.14996707, y: 1.0607213, z: 0.80295485}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 11
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!65 &1840065107
BoxCollider:
m_ObjectHideFlags: 0

View File

@ -83,6 +83,13 @@ public static class JsonConfiguration {
saveFile();
}
public static void SetFloatArray(string key, float[] numbers) {
ensureInitialization();
config[key] = JArray.FromObject(numbers);
saveFile();
}
public static bool GetBoolean(string key) {
ensureInitialization();
@ -104,4 +111,9 @@ public static class JsonConfiguration {
return config.Value<double>(key);
}
public static float[] GetFloatArray(string key) {
ensureInitialization();
return config.Value<float[]>(key);
}
}

View File

@ -0,0 +1,62 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class SettingsManager : MonoBehaviour
{
public double DefaultPhysicFPS = 90;
public double DefaultHandSize = 7;
public float[] DefaultHandPosition = {2f, -2f, 7f};
private bool FocusChecked;
public GameObject Display;
public GameObject LHand;
public GameObject RHand;
UwcConfigurator UwcConfig;
void Start()
{
UwcConfig = Display.GetComponent<UwcConfigurator>();
UpdateAllConfigs();
}
void Update()
{
if (Input.GetKeyDown(KeyCode.F5) | !FocusChecked) //Update ConfigFile
{
if (Application.isFocused)
{
FocusChecked=true;
UpdateAllConfigs();
}
}
if (!Application.isFocused)
FocusChecked=false;
}
void UpdateAllConfigs()
{
UwcConfig.UpdateConfigs();
UpdatePhysicFPS();
UpdateHands();
}
void UpdatePhysicFPS()
{
if (!JsonConfiguration.HasKey("PhysicFPS"))
JsonConfiguration.SetDouble("PhysicFPS", DefaultPhysicFPS);
Time.fixedDeltaTime = 1/(float)JsonConfiguration.GetDouble("PhysicFPS");
}
void UpdateHands()
{
if (!JsonConfiguration.HasKey("HandSize"))
JsonConfiguration.SetDouble("HandSize", DefaultHandSize);
if (!JsonConfiguration.HasKey("HandPosition"))
JsonConfiguration.SetFloatArray("HandPosition", DefaultHandPosition);
float HandSize = (float)JsonConfiguration.GetDouble("HandSize");
float[] HandPosition = JsonConfiguration.GetFloatArray("HandPosition");
LHand.transform.localScale = new Vector3(HandSize/100,HandSize/100,HandSize/100);
RHand.transform.localScale = new Vector3(HandSize/100,HandSize/100,HandSize/100);
LHand.transform.localPosition = new Vector3(HandPosition[0]/100,HandPosition[1]/100,HandPosition[2]/100);
RHand.transform.localPosition = new Vector3(HandPosition[0]/-100,HandPosition[1]/100,HandPosition[2]/100);
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: a76604ac77e1add42b84974256adc28e
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -6,7 +6,15 @@ public class UwcConfigurator : MonoBehaviour {
void Start() {
uwcWindowTexture = GetComponent<UwcWindowTexture>();
UpdateConfigs();
}
void SwitchToDesktopCapture() {
uwcWindowTexture.type = WindowTextureType.Desktop;
uwcWindowTexture.desktopIndex = JsonConfiguration.GetInt("CaptureDesktopNumber");
}
public void UpdateConfigs()
{
if (JsonConfiguration.HasKey("CaptureMode")) {
int rawCaptureMode = JsonConfiguration.GetInt("CaptureMode");
@ -30,9 +38,4 @@ public class UwcConfigurator : MonoBehaviour {
else
JsonConfiguration.SetBoolean("CaptureDesktop", false);
}
void SwitchToDesktopCapture() {
uwcWindowTexture.type = WindowTextureType.Desktop;
uwcWindowTexture.desktopIndex = JsonConfiguration.GetInt("CaptureDesktopNumber");
}
}

View File

@ -19,6 +19,7 @@ MonoBehaviour:
m_RendererFeatureMap:
m_UseNativeRenderPass: 0
postProcessData: {fileID: 11400000, guid: 41439944d30ece34e96484bdb6645b55, type: 2}
xrSystemData: {fileID: 11400000, guid: 60e1133243b97e347b653163a8c01b64, type: 2}
shaders:
blitPS: {fileID: 4800000, guid: c17132b1f77d20942aa75f8429c0f8bc, type: 3}
copyDepthPS: {fileID: 4800000, guid: d6dae50ee9e1bfa4db75f19f99355220, type: 3}
@ -27,10 +28,14 @@ MonoBehaviour:
stencilDeferredPS: {fileID: 4800000, guid: e9155b26e1bc55942a41e518703fe304, type: 3}
fallbackErrorPS: {fileID: 4800000, guid: e6e9a19c3678ded42a3bc431ebef7dbd, type: 3}
materialErrorPS: {fileID: 4800000, guid: 5fd9a8feb75a4b5894c241777f519d4e, type: 3}
coreBlitPS: {fileID: 0}
coreBlitColorAndDepthPS: {fileID: 0}
cameraMotionVector: {fileID: 0}
objectMotionVector: {fileID: 0}
coreBlitPS: {fileID: 4800000, guid: 93446b5c5339d4f00b85c159e1159b7c, type: 3}
coreBlitColorAndDepthPS: {fileID: 4800000, guid: d104b2fc1ca6445babb8e90b0758136b,
type: 3}
cameraMotionVector: {fileID: 4800000, guid: c56b7e0d4c7cb484e959caeeedae9bbf,
type: 3}
objectMotionVector: {fileID: 4800000, guid: 7b3ede40266cd49a395def176e1bc486,
type: 3}
m_AssetVersion: 1
m_OpaqueLayerMask:
serializedVersion: 2
m_Bits: 4294967295
@ -50,3 +55,4 @@ MonoBehaviour:
m_AccurateGbufferNormals: 0
m_ClusteredRendering: 0
m_TileSize: 32
m_IntermediateTextureMode: 1