1
0
mirror of https://github.com/xiaopeng12138/MaiDXR.git synced 2024-11-24 03:50:10 +01:00

multiplayer color identify

This commit is contained in:
xpeng 2022-08-27 02:19:29 +02:00
parent 42662152ee
commit 9d02f0585e
13 changed files with 387 additions and 116 deletions

127
Assets/Materials/HeadP1.mat Normal file
View File

@ -0,0 +1,127 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &-103799782333269554
MonoBehaviour:
m_ObjectHideFlags: 11
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
m_Name:
m_EditorClassIdentifier:
version: 5
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: HeadP1
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
m_ValidKeywords:
- _EMISSION
m_InvalidKeywords: []
m_LightmapFlags: 2
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap:
RenderType: Opaque
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BaseMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_Lightmaps:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_LightmapsInd:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_ShadowMasks:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _AlphaClip: 0
- _Blend: 0
- _BumpScale: 1
- _ClearCoatMask: 0
- _ClearCoatSmoothness: 0
- _Cull: 2
- _Cutoff: 0.5
- _DetailAlbedoMapScale: 1
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _EnvironmentReflections: 1
- _GlossMapScale: 0
- _Glossiness: 0
- _GlossyReflections: 0
- _Metallic: 0
- _OcclusionStrength: 1
- _Parallax: 0.005
- _QueueOffset: 0
- _ReceiveShadows: 1
- _Smoothness: 0.6
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _Surface: 0
- _WorkflowMode: 1
- _ZWrite: 1
m_Colors:
- _BaseColor: {r: 0.389, g: 0.73866874, b: 1, a: 1}
- _Color: {r: 0.38899997, g: 0.73866874, b: 1, a: 1}
- _EmissionColor: {r: 0.055263013, g: 0.16309513, b: 0.32700002, a: 1}
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
m_BuildTextureStacks: []

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 7ce3a6249153af844bf867530900838d
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

127
Assets/Materials/HeadP2.mat Normal file
View File

@ -0,0 +1,127 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &-103799782333269554
MonoBehaviour:
m_ObjectHideFlags: 11
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
m_Name:
m_EditorClassIdentifier:
version: 5
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: HeadP2
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
m_ValidKeywords:
- _EMISSION
m_InvalidKeywords: []
m_LightmapFlags: 2
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap:
RenderType: Opaque
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BaseMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_Lightmaps:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_LightmapsInd:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_ShadowMasks:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _AlphaClip: 0
- _Blend: 0
- _BumpScale: 1
- _ClearCoatMask: 0
- _ClearCoatSmoothness: 0
- _Cull: 2
- _Cutoff: 0.5
- _DetailAlbedoMapScale: 1
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _EnvironmentReflections: 1
- _GlossMapScale: 0
- _Glossiness: 0
- _GlossyReflections: 0
- _Metallic: 0
- _OcclusionStrength: 1
- _Parallax: 0.005
- _QueueOffset: 0
- _ReceiveShadows: 1
- _Smoothness: 0.6
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _Surface: 0
- _WorkflowMode: 1
- _ZWrite: 1
m_Colors:
- _BaseColor: {r: 0.45221606, g: 0.90900004, b: 0.41567338, a: 1}
- _Color: {r: 0.45221597, g: 0.90900004, b: 0.41567335, a: 1}
- _EmissionColor: {r: 0.08937143, g: 0.39099997, b: 0.070752375, a: 1}
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
m_BuildTextureStacks: []

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 0775247bf24b95f4daae8a5090a4697e
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -13,7 +13,6 @@ GameObject:
- component: {fileID: 149481172096803373}
- component: {fileID: 149481172096803370}
- component: {fileID: 149481172096803371}
- component: {fileID: 5785614773386781349}
- component: {fileID: 4318516477145814445}
m_Layer: 0
m_Name: RHand
@ -116,32 +115,6 @@ Rigidbody:
m_Interpolate: 0
m_Constraints: 0
m_CollisionDetection: 0
--- !u!114 &5785614773386781349
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 149481172096803369}
m_Enabled: 0
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: df2868252ab5c4d1da357e8f11f1b524, type: 3}
m_Name:
m_EditorClassIdentifier:
SyncPositionX: 0
SyncPositionY: 0
SyncPositionZ: 0
SyncRotAngleX: 0
SyncRotAngleY: 0
SyncRotAngleZ: 0
SyncScaleX: 1
SyncScaleY: 1
SyncScaleZ: 1
PositionThreshold: 0.001
RotAngleThreshold: 0.01
ScaleThreshold: 0.005
InLocalSpace: 0
Interpolate: 0
--- !u!114 &4318516477145814445
MonoBehaviour:
m_ObjectHideFlags: 0
@ -170,7 +143,6 @@ GameObject:
- component: {fileID: 149481172127065658}
- component: {fileID: 149481172127065659}
- component: {fileID: 149481172127065663}
- component: {fileID: 4540214490382732089}
- component: {fileID: 2613443299298391039}
m_Layer: 0
m_Name: LHand
@ -273,32 +245,6 @@ Rigidbody:
m_Interpolate: 0
m_Constraints: 0
m_CollisionDetection: 0
--- !u!114 &4540214490382732089
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 149481172127065656}
m_Enabled: 0
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: df2868252ab5c4d1da357e8f11f1b524, type: 3}
m_Name:
m_EditorClassIdentifier:
SyncPositionX: 0
SyncPositionY: 0
SyncPositionZ: 0
SyncRotAngleX: 0
SyncRotAngleY: 0
SyncRotAngleZ: 0
SyncScaleX: 1
SyncScaleY: 1
SyncScaleZ: 1
PositionThreshold: 0.001
RotAngleThreshold: 0.01
ScaleThreshold: 0.005
InLocalSpace: 0
Interpolate: 0
--- !u!114 &2613443299298391039
MonoBehaviour:
m_ObjectHideFlags: 0
@ -1700,8 +1646,11 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 5be4365f045c3264ea500128c655fae6, type: 3}
m_Name:
m_EditorClassIdentifier:
Player1Position: {x: -0.75, y: 0}
Player2Position: {x: 0.75, y: 0}
Player1Position: {x: -0.5, y: 0.5}
Player2Position: {x: 0.5, y: 0.5}
MaterialP1: {fileID: 2100000, guid: 7ce3a6249153af844bf867530900838d, type: 2}
MaterialP2: {fileID: 2100000, guid: 0775247bf24b95f4daae8a5090a4697e, type: 2}
HandHueShift: -0.05
--- !u!114 &5523943268535035658
MonoBehaviour:
m_ObjectHideFlags: 0

View File

@ -261,8 +261,8 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 13422699}
m_LocalRotation: {x: -0.8196523, y: 0, z: 0, w: 0.57286143}
m_LocalPosition: {x: 0.5110072, y: 1.429, z: 0.073}
m_LocalScale: {x: 102.49999, y: 102.475494, z: 102.475494}
m_LocalPosition: {x: 0.5110072, y: 1.4269, z: 0.0687}
m_LocalScale: {x: 102.77, y: 102.74543, z: 102.74543}
m_ConstrainProportionsScale: 1
m_Children: []
m_Father: {fileID: 1775131856}
@ -803,13 +803,15 @@ MonoBehaviour:
m_Placeholder: {fileID: 0}
m_ItemText: {fileID: 1016472457}
m_ItemImage: {fileID: 0}
m_Value: 2
m_Value: 3
m_Options:
m_Options:
- m_Text: 30
m_Image: {fileID: 0}
- m_Text: 60
m_Image: {fileID: 0}
- m_Text: 72
m_Image: {fileID: 0}
- m_Text: 90
m_Image: {fileID: 0}
- m_Text: 120
@ -3266,6 +3268,7 @@ GameObject:
- component: {fileID: 357334434}
- component: {fileID: 357334432}
- component: {fileID: 357334436}
- component: {fileID: 357334437}
m_Layer: 0
m_Name: NVRCamera
m_TagString: Untagged
@ -3377,8 +3380,25 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
target: {fileID: 0}
smoothSpeed: 0.0125
smoothSpeed: 0.03
PositionOffset: {x: 0, y: 0, z: 0}
--- !u!114 &357334437
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 357334431}
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}
CameraSmooth: {fileID: 357334436}
--- !u!1 &358458036
GameObject:
m_ObjectHideFlags: 0
@ -8072,12 +8092,12 @@ PrefabInstance:
- target: {fileID: 795547410136657018, guid: 4cbf0dbca1ca1a5499c4b7806ab6aac5,
type: 3}
propertyPath: m_LocalPosition.y
value: 1.4279
value: 1.425
objectReference: {fileID: 0}
- target: {fileID: 795547410136657018, guid: 4cbf0dbca1ca1a5499c4b7806ab6aac5,
type: 3}
propertyPath: m_LocalPosition.z
value: 0.0691
value: 0.07
objectReference: {fileID: 0}
- target: {fileID: 795547410136657018, guid: 4cbf0dbca1ca1a5499c4b7806ab6aac5,
type: 3}
@ -10211,7 +10231,7 @@ MonoBehaviour:
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: 60
m_text: 90
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
@ -16087,7 +16107,7 @@ MonoBehaviour:
m_Placeholder: {fileID: 0}
m_ItemText: {fileID: 822698504}
m_ItemImage: {fileID: 0}
m_Value: 3
m_Value: 5
m_Options:
m_Options:
- m_Text: 15
@ -16098,46 +16118,14 @@ MonoBehaviour:
m_Image: {fileID: 0}
- m_Text: 60
m_Image: {fileID: 0}
- m_Text: 72
m_Image: {fileID: 0}
- m_Text: 90
m_Image: {fileID: 0}
- m_Text: 120
m_Image: {fileID: 0}
- m_Text: 144
m_Image: {fileID: 0}
- m_Text: 144
m_Image: {fileID: 0}
- m_Text: 144
m_Image: {fileID: 0}
- m_Text: 144
m_Image: {fileID: 0}
- m_Text: 144
m_Image: {fileID: 0}
- m_Text: 144
m_Image: {fileID: 0}
- m_Text: 144
m_Image: {fileID: 0}
- m_Text: 144
m_Image: {fileID: 0}
- m_Text: 144
m_Image: {fileID: 0}
- m_Text: 144
m_Image: {fileID: 0}
- m_Text: 144
m_Image: {fileID: 0}
- m_Text: 144
m_Image: {fileID: 0}
- m_Text: 144
m_Image: {fileID: 0}
- m_Text: 144
m_Image: {fileID: 0}
- m_Text: 144
m_Image: {fileID: 0}
- m_Text: 144
m_Image: {fileID: 0}
- m_Text: 144
m_Image: {fileID: 0}
- m_Text: 144
m_Image: {fileID: 0}
m_OnValueChanged:
m_PersistentCalls:
m_Calls:
@ -25007,13 +24995,13 @@ MonoBehaviour:
m_SelectEntered:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 2062235788}
m_TargetAssemblyTypeName:
m_MethodName:
- m_Target: {fileID: 2062235792}
m_TargetAssemblyTypeName: Locker, Config
m_MethodName: ToggleLocker
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName:
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:

View File

@ -84,12 +84,15 @@ public class CaptureSettingManager : MonoBehaviour
WindowTexture.captureFrameRate = 60;
break;
case 2:
WindowTexture.captureFrameRate = 90;
WindowTexture.captureFrameRate = 72;
break;
case 3:
WindowTexture.captureFrameRate = 120;
WindowTexture.captureFrameRate = 90;
break;
case 4:
WindowTexture.captureFrameRate = 120;
break;
case 5:
WindowTexture.captureFrameRate = 144;
break;
}

View File

@ -30,6 +30,9 @@ public class NoneVRSettingManager : MonoBehaviour
case "TPCameraCube":
GetTPCamTransform();
break;
case "NVRCamera":
GetNVRSmoothSpeed();
break;
}
}
@ -37,9 +40,13 @@ public class NoneVRSettingManager : MonoBehaviour
{
if (JsonConfig.HasKey("NVRMode"))
Dropdown.value = JsonConfig.GetInt("NVRMode");
SetNVRMode();
}
void GetNVRSmoothSpeed()
{
if (JsonConfig.HasKey("NVRCameraSmooth"))
CameraSmooth.smoothSpeed = (float)JsonConfig.GetDouble("NVRCameraSmooth");
SetNVRMode();
SetNVRSmoothSpeed();
}
public void GetNVRFOV()
{
@ -76,18 +83,23 @@ public class NoneVRSettingManager : MonoBehaviour
if (!NVRCameraObj.activeSelf)
NVRCameraObj.SetActive(true);
CameraSmooth.target = NVRCameraTargetFP;
NVRCamera.cullingMask |= 1 << LayerMask.NameToLayer("FPSBlock"); // Enable FPBlock
NVRCamera.cullingMask &= ~(1 << LayerMask.NameToLayer("TPSBlock")); // Disable TPBlock
NVRCamera.cullingMask |= 1 << LayerMask.NameToLayer("TPSBlock"); // Enable TPBlock Layer Mask
NVRCamera.cullingMask &= ~(1 << LayerMask.NameToLayer("FPSBlock")); // Disable FPBlock Layer Mask
break;
case 2:
if (!NVRCameraObj.activeSelf)
NVRCameraObj.SetActive(true);
CameraSmooth.target = NVRCameraTargetTP;
NVRCamera.cullingMask |= 1 << LayerMask.NameToLayer("TPSBlock"); // Enable TPBlock
NVRCamera.cullingMask &= ~(1 << LayerMask.NameToLayer("FPSBlock")); // Disable FPBlock
NVRCamera.cullingMask |= 1 << LayerMask.NameToLayer("FPSBlock"); // Enable FPBlock Layer Mask
NVRCamera.cullingMask &= ~(1 << LayerMask.NameToLayer("TPSBlock")); // Disable TPBlock Layer Mask
break;
}
JsonConfig.SetInt("NVRMode", Dropdown.value);
}
void SetNVRSmoothSpeed()
{
JsonConfig.SetDouble("NVRCameraSmooth", CameraSmooth.smoothSpeed);
}
public void SetNVRFOV(float fov)
@ -112,12 +124,15 @@ public class NoneVRSettingManager : MonoBehaviour
Application.targetFrameRate = 60;
break;
case 4:
Application.targetFrameRate = 90;
Application.targetFrameRate = 72;
break;
case 5:
Application.targetFrameRate = 120;
Application.targetFrameRate = 90;
break;
case 6:
Application.targetFrameRate = 120;
break;
case 7:
Application.targetFrameRate = 144;
break;
}

View File

@ -5,16 +5,20 @@ using UnityEngine.XR.Interaction.Toolkit;
public class NetworkPlayer : NetworkBehaviour
{
public Vector2 Player1Position = new Vector2(-0.75f, 0);
public Vector2 Player2Position = new Vector2(0.75f, 0);
public Vector2 Player1Position = new Vector2(-0.6f, 0.5f);
public Vector2 Player2Position = new Vector2(0.6f, 0.5f);
public Material MaterialP1 = null;
public Material MaterialP2 = null;
public float HandHueShift = 0.2f;
public override void OnNetworkSpawn()
{
//base.OnNetworkSpawn();
DisableClientInput();
SetMaterials();
}
private void DisableClientInput()
{
if (!IsOwner)
{
var clientMoveProvider = GetComponent<ActionBasedContinuousMoveProvider>();
@ -49,15 +53,37 @@ public class NetworkPlayer : NetworkBehaviour
//clientOVRManager.SetActive(false);
}
}
private void Start()
private void SetMaterials()
{
if (IsHost)
var HeadMat = transform.Find("Camera Offset").Find("Main Camera").Find("HeadCube").gameObject.GetComponent<Renderer>().material;
var LHandMat = transform.Find("Camera Offset").Find("LeftHand Controller").Find("LHand").GetComponent<Renderer>().material;
var RHandMat = transform.Find("Camera Offset").Find("RightHand Controller").Find("RHand").GetComponent<Renderer>().material;
if (IsOwnedByServer)
{
transform.position = new Vector3(Player1Position.x, transform.position.y, Player1Position.y);
HeadMat = MaterialP1;
}
else
{
transform.position = new Vector3(Player2Position.x, transform.position.y, Player2Position.y);
HeadMat = MaterialP2;
float LH, LS, LV; float RH, RS, RV;
Color.RGBToHSV(LHandMat.color, out LH, out LS, out LV);
Color.RGBToHSV(RHandMat.color, out RH, out RS, out RV);
LH += HandHueShift; RH += HandHueShift;
LHandMat.color = Color.HSVToRGB(LH, RS, RV);
RHandMat.color = Color.HSVToRGB(RH, RS, RV);
}
}
private void Start()
{
if (IsHost)
{
transform.position = new Vector3(Player1Position.x, transform.position.y, transform.position.z + Player1Position.y);
}
else
{
transform.position = new Vector3(Player2Position.x, transform.position.y, transform.position.z + Player2Position.y);
}
}
}

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: cbf498d537c04dd4e9f2720eed7a1319
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1 @@
{"Keys":["com.unity.services.core.cloud-environment","com.unity.services.qos.version","com.unity.services.lobby.version","com.unity.services.core.version","com.unity.services.authentication.version","com.unity.services.relay.version"],"Values":[{"m_Value":"production","m_IsReadOnly":true},{"m_Value":"1.0.1","m_IsReadOnly":true},{"m_Value":"1.0.1","m_IsReadOnly":true},{"m_Value":"1.4.2","m_IsReadOnly":true},{"m_Value":"2.1.1","m_IsReadOnly":true},{"m_Value":"1.0.3","m_IsReadOnly":true}]}

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 5850fa29d5b8ecb4a90d8708db37eb9d
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -196,6 +196,10 @@ PlayerSettings:
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: -6018045015233401694, guid: 3999ab811e936714280a476b3a032d86, type: 2}
- {fileID: 6536100391545742739, guid: 55d1ec7a4296de343b6d3bb6f9a19731, type: 2}
metroInputSource: 0