non-vr lobby, version fix

This commit is contained in:
joonasp
2022-06-29 14:45:17 +03:00
parent 5774be9822
commit 04baadfad1
1774 changed files with 573069 additions and 1533 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 2cac614b54ea2ca4c8e4e74666565dc9
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,91 @@
using System;
using System.Collections.Generic;
using UnityEngine.InputSystem;
using Photon.Pun;
namespace UnityEngine.XR.Interaction.Toolkit.Inputs
{
/// <summary>
/// Use this class to automatically enable or disable all the inputs of type <see cref="InputAction"/>
/// in a list of assets of type <see cref="InputActionAsset"/>.
/// </summary>
/// <remarks>
/// Actions are initially disabled, meaning they do not listen/react to input yet. This class
/// is used to mass enable actions so that they actively listen for input and run callbacks.
/// </remarks>
/// <seealso cref="InputAction"/>
public class InputActionManager : MonoBehaviourPunCallbacks
{
[SerializeField]
[Tooltip("Input action assets to affect when inputs are enabled or disabled.")]
List<InputActionAsset> m_ActionAssets;
/// <summary>
/// Input action assets to affect when inputs are enabled or disabled.
/// </summary>
public List<InputActionAsset> actionAssets
{
get => m_ActionAssets;
set => m_ActionAssets = value ?? throw new ArgumentNullException(nameof(value));
}
protected void OnEnable()
{
if(photonView.IsMine) EnableInput();
}
protected void OnDisable()
{
if (photonView.IsMine) DisableInput();
}
/// <summary>
/// Enable all actions referenced by this component.
/// </summary>
/// <remarks>
/// This function will automatically be called when this <see cref="InputActionManager"/> component is enabled.
/// However, this method can be called to enable input manually, such as after disabling it with <see cref="DisableInput"/>.
/// <br />
/// Note that enabling inputs will only enable the action maps contained within the referenced
/// action map assets (see <see cref="actionAssets"/>).
/// </remarks>
/// <seealso cref="DisableInput"/>
public void EnableInput()
{
if (m_ActionAssets == null)
return;
foreach (var actionAsset in m_ActionAssets)
{
if (actionAsset != null)
{
actionAsset.Enable();
}
}
}
/// <summary>
/// Disable all actions referenced by this component.
/// </summary>
/// <remarks>
/// This function will automatically be called when this <see cref="InputActionManager"/> component is disabled.
/// However, this method can be called to disable input manually, such as after enabling it with <see cref="EnableInput"/>.
/// <br />
/// Note that disabling inputs will only disable the action maps contained within the referenced
/// action map assets (see <see cref="actionAssets"/>).
/// </remarks>
/// <seealso cref="EnableInput"/>
public void DisableInput()
{
if (m_ActionAssets == null)
return;
foreach (var actionAsset in m_ActionAssets)
{
if (actionAsset != null)
{
actionAsset.Disable();
}
}
}
}
}

View File

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

View File

@@ -0,0 +1,372 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &3792194066035821785
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2728055905554767678}
- component: {fileID: 6470632201704000592}
m_Layer: 0
m_Name: Point Light
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &2728055905554767678
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3792194066035821785}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0.084, y: 1.065, z: 0.77}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 3917920774390578430}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!108 &6470632201704000592
Light:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3792194066035821785}
m_Enabled: 1
serializedVersion: 10
m_Type: 2
m_Shape: 0
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_Intensity: 0.1
m_Range: 10
m_SpotAngle: 30
m_InnerSpotAngle: 21.80208
m_CookieSize: 10
m_Shadows:
m_Type: 0
m_Resolution: -1
m_CustomResolution: -1
m_Strength: 1
m_Bias: 0.05
m_NormalBias: 0.4
m_NearPlane: 0.2
m_CullingMatrixOverride:
e00: 1
e01: 0
e02: 0
e03: 0
e10: 0
e11: 1
e12: 0
e13: 0
e20: 0
e21: 0
e22: 1
e23: 0
e30: 0
e31: 0
e32: 0
e33: 1
m_UseCullingMatrixOverride: 0
m_Cookie: {fileID: 0}
m_DrawHalo: 0
m_Flare: {fileID: 0}
m_RenderMode: 0
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_RenderingLayerMask: 1
m_Lightmapping: 4
m_LightShadowCasterMode: 0
m_AreaSize: {x: 1, y: 1}
m_BounceIntensity: 1
m_ColorTemperature: 6570
m_UseColorTemperature: 0
m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0}
m_UseBoundingSphereOverride: 0
m_UseViewFrustumForShadowCasterCull: 1
m_ShadowRadius: 0
m_ShadowAngle: 0
--- !u!1 &3917920774390578431
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 3917920774390578430}
m_Layer: 0
m_Name: Mannequin
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &3917920774390578430
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3917920774390578431}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -0.954, y: 0, z: -0.174}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 3917920775105521855}
- {fileID: 3917920775328741170}
- {fileID: 3917920774592251871}
- {fileID: 2728055905554767678}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &3917920774592251808
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 3917920774592251871}
- component: {fileID: 3917920774592251869}
- component: {fileID: 3917920774592251870}
m_Layer: 0
m_Name: Lhand
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &3917920774592251871
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3917920774592251808}
m_LocalRotation: {x: -0, y: 0.42993057, z: -0, w: 0.90286195}
m_LocalPosition: {x: -0.0510298, y: 0.722, z: 0.28198734}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 3917920774390578430}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 50.926, z: 0}
--- !u!23 &3917920774592251869
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3917920774592251808}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RayTraceProcedural: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: -7974662883447924875, guid: cf1947c0fc791164285826ce282c815b, type: 3}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!33 &3917920774592251870
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3917920774592251808}
m_Mesh: {fileID: 4300000, guid: ca20b3907ff1c794cb89c1ad2cce8282, type: 3}
--- !u!1 &3917920775105521792
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 3917920775105521855}
- component: {fileID: 3917920775105521853}
- component: {fileID: 3917920775105521854}
m_Layer: 0
m_Name: Head
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &3917920775105521855
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3917920775105521792}
m_LocalRotation: {x: -0.6532815, y: 0.27059805, z: 0.27059805, w: 0.6532815}
m_LocalPosition: {x: -0.315, y: 1.026, z: 0.315}
m_LocalScale: {x: 0.05, y: 0.05, z: 0.05}
m_Children: []
m_Father: {fileID: 3917920774390578430}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: -90, y: 45, z: 0}
--- !u!33 &3917920775105521853
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3917920775105521792}
m_Mesh: {fileID: -462981019419857548, guid: e4b72324637d359459d572e99ea05981, type: 3}
--- !u!23 &3917920775105521854
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3917920775105521792}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RayTraceProcedural: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 8598954236217306308, guid: e4b72324637d359459d572e99ea05981, type: 3}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!1 &3917920775328741171
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 3917920775328741170}
- component: {fileID: 3917920775328741168}
- component: {fileID: 3917920775328741169}
m_Layer: 0
m_Name: Rhand
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &3917920775328741170
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3917920775328741171}
m_LocalRotation: {x: 0.110257715, y: 0.30503958, z: -0.038682856, w: 0.94514436}
m_LocalPosition: {x: -0.442, y: 0.722, z: 0.605}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 3917920774390578430}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 13.416, y: 35.734, z: -0.345}
--- !u!23 &3917920775328741168
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3917920775328741171}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RayTraceProcedural: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: -7974662883447924875, guid: cf1947c0fc791164285826ce282c815b, type: 3}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!33 &3917920775328741169
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3917920775328741171}
m_Mesh: {fileID: 4300000, guid: d0c255d07fd68f14b94e55d388e7e6bb, type: 3}

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 46f5a71041d598b4d8183883b67ba09c
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: c05533743467d3d4ca4564c956e7a59a
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,53 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Photon.Pun;
using Photon.Realtime;
//The following script is made following this tutorial: https://www.youtube.com/watch?v=KHWuTBmT1oI
public class NetworkManager : MonoBehaviourPunCallbacks
{
// Start is called before the first frame update
void Start()
{
ConnectToServer();
}
// Update is called once per frame
void Update()
{
}
void ConnectToServer()
{
PhotonNetwork.ConnectUsingSettings();
Debug.Log("Connecting...");
}
public override void OnConnectedToMaster()
{
Debug.Log("Connected");
base.OnConnectedToMaster();
RoomOptions roomOptions = new RoomOptions();
roomOptions.MaxPlayers = 16;
roomOptions.IsVisible = true;
roomOptions.IsOpen = true;
PhotonNetwork.JoinOrCreateRoom("Room 1", roomOptions, TypedLobby.Default);
}
public override void OnJoinedRoom()
{
Debug.Log("Room joined");
base.OnJoinedRoom();
}
public override void OnPlayerEnteredRoom(Player newPlayer)
{
Debug.Log("Player joined");
base.OnPlayerEnteredRoom(newPlayer);
}
}

View File

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

View File

@@ -0,0 +1,28 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Photon.Pun;
using Photon.Realtime;
using TMPro;
//The following script is made following this tutorial: https://www.youtube.com/watch?v=KHWuTBmT1oI
public class NetworkPlayerSpawner : MonoBehaviourPunCallbacks
{
public GameObject spawnedPlayer;
public override void OnJoinedRoom()
{
base.OnJoinedRoom();
GameObject player = PhotonNetwork.Instantiate("Player_VRFree_Network", transform.position, transform.rotation);
}
public override void OnLeftRoom()
{
base.OnLeftRoom();
PhotonNetwork.Destroy(spawnedPlayer);
}
}

View File

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

View File

@@ -0,0 +1,37 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.XR.Interaction.Toolkit;
using Photon.Pun;
using Photon.Realtime;
//The following script is made following this tutorial: https://www.youtube.com/watch?v=KHWuTBmT1oI
public class NetworkPlayerSpawnerVR : MonoBehaviourPunCallbacks
{
public GameObject spawnedPlayer;
public List<GameObject> spawnedPlayers = new List<GameObject>();
public TeleportationProvider teleportationProvider;
public override void OnJoinedRoom()
{
base.OnJoinedRoom();
GameObject player = PhotonNetwork.Instantiate("XR Rig_Network", transform.position, transform.rotation);
if (CharacterInfo.Instance.GetName() == "") player.name = player.GetPhotonView().ViewID.ToString();
else player.name = CharacterInfo.Instance.GetName();
spawnedPlayers.Add(player);
if (player.GetPhotonView().IsMine)
{
teleportationProvider.system = player.GetComponent<LocomotionSystem>();
}
}
public override void OnLeftRoom()
{
base.OnLeftRoom();
PhotonNetwork.Destroy(spawnedPlayer);
}
}

View File

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

View File

@@ -0,0 +1,23 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Photon.Pun;
using Photon.Realtime;
public class VRNetworkController : MonoBehaviourPunCallbacks
{
private void Awake()
{
print("TEST");
if (!photonView.IsMine)
{
gameObject.SetActive(false);
}
else
{
gameObject.SetActive(true);
}
}
}

View File

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

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: a557f9ff5cea35a4dbbb7ac8b20533a3
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant: