Skip to content

Commit

Permalink
Fixed issues with back compatibility and updated room scaling.
Browse files Browse the repository at this point in the history
  • Loading branch information
David Liebemann committed Sep 8, 2022
1 parent 443ed48 commit 93fd857
Show file tree
Hide file tree
Showing 14 changed files with 108 additions and 105 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1496,7 +1496,6 @@ MonoBehaviour:
gamepadAxis: {fileID: -8589268155453388520, guid: 569da38d22d72724586e88d08c36b7a6, type: 3}
mouseDelta: {fileID: 8009718129426777221, guid: 569da38d22d72724586e88d08c36b7a6, type: 3}
rotationSpeed: 0.6
mobileRotationSpeedMultiplier: 0.75
mouseRotationSpeedMultiplier: 0.25
clampPitch: 80
yawTarget: {fileID: 2753487309498945351}
Expand Down
52 changes: 31 additions & 21 deletions ODIN-SampleProject/Assets/ODIN-Sample/Scenes/DemoLevel.unity
Original file line number Diff line number Diff line change
Expand Up @@ -11593,34 +11593,14 @@ GameObject:
m_Component:
- component: {fileID: 894799058}
- component: {fileID: 894799057}
- component: {fileID: 894799056}
- component: {fileID: 894799059}
m_Layer: 0
m_Name: EventSystem
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &894799056
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 894799055}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4f231c4fb786f3946a6b90b886c48677, type: 3}
m_Name:
m_EditorClassIdentifier:
m_SendPointerHoverToParent: 1
m_HorizontalAxis: MenuHorizontal
m_VerticalAxis: MenuVertical
m_SubmitButton: Submit
m_CancelButton: Cancel
m_InputActionsPerSecond: 10
m_RepeatDelay: 0.5
m_ForceModuleActive: 0
--- !u!114 &894799057
MonoBehaviour:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -11651,6 +11631,36 @@ Transform:
m_Father: {fileID: 1343085400}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &894799059
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 894799055}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 01614664b831546d2ae94a42149d80ac, type: 3}
m_Name:
m_EditorClassIdentifier:
m_SendPointerHoverToParent: 1
m_MoveRepeatDelay: 0.5
m_MoveRepeatRate: 0.1
m_XRTrackingOrigin: {fileID: 0}
m_ActionsAsset: {fileID: -944628639613478452, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
m_PointAction: {fileID: -1654692200621890270, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
m_MoveAction: {fileID: -8784545083839296357, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
m_SubmitAction: {fileID: 392368643174621059, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
m_CancelAction: {fileID: 7727032971491509709, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
m_LeftClickAction: {fileID: 3001919216989983466, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
m_MiddleClickAction: {fileID: -2185481485913320682, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
m_RightClickAction: {fileID: -4090225696740746782, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
m_ScrollWheelAction: {fileID: 6240969308177333660, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
m_TrackedDevicePositionAction: {fileID: 6564999863303420839, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
m_TrackedDeviceOrientationAction: {fileID: 7970375526676320489, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
m_DeselectOnBackgroundClick: 1
m_PointerBehavior: 0
m_CursorLockBehavior: 0
--- !u!1001 &897394605
PrefabInstance:
m_ObjectHideFlags: 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public abstract class AAudioListenerEffect : MonoBehaviour
[SerializeField] protected bool includeInactiveAudioSourcesInSearch = true;


protected readonly Dictionary<int, AudioSourceData> DetectedAudioSources = new();
protected readonly Dictionary<int, AudioSourceData> DetectedAudioSources = new Dictionary<int, AudioSourceData>();


protected virtual void Awake()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public struct AudioEffectData
/// Returns a default object, containing effect values that are not perceivable.
/// </summary>
public static AudioEffectData Default =>
new()
new AudioEffectData()
{
Volume = 1.0f,
CutoffFrequency = 22000.0f,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,7 @@ public class FirstPersonRotation : MonoBehaviour
/// The rotation speed.
/// </summary>
[SerializeField] private float rotationSpeed = 200.0f;

/// <summary>
/// On mobile, a slower rotation speed is preferable.
/// </summary>
[SerializeField] private float mobileRotationSpeedMultiplier = 0.5f;

[SerializeField] private float mouseRotationSpeedMultiplier = 0.25f;


Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using UnityEngine;
using UnityEngine.UI;

namespace ODIN_Sample.Scripts.Runtime.ODIN.Utility
namespace ODIN_Sample.Scripts.Runtime.GameLogic
{
/// <summary>
/// Utility script for resetting the slider position to the start.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,10 @@ private IEnumerator DelayedEnable()
{
while (!OdinHandler.Instance)
yield return null;


foreach (Room room in OdinHandler.Instance.Rooms) InitRoom(room);
OdinHandler.Instance.OnRoomJoined.AddListener(OnRoomJoined);

yield return null;
UpdateAllRoomPositions();
// Give ODIN a chance to setup the room
foreach (Room room in OdinHandler.Instance.Rooms) InitRoom(room);
StartCoroutine(UpdatePositionRoutine());
}

Expand All @@ -60,8 +57,11 @@ private void OnRoomJoined(RoomJoinedEventArgs eventArgs)
/// <param name="targetRoom">Room to initialize position scale in.</param>
private void InitRoom(Room targetRoom)
{
OdinRoomProximityStatus status = settings.GetRoomProximityStatus(targetRoom.Config.Name);
if (null != status && status.isActive) targetRoom.SetPositionScale(1.0f / status.proximityRadius);
if (targetRoom.IsJoined)
{
OdinRoomProximityStatus status = settings.GetRoomProximityStatus(targetRoom.Config.Name);
if (null != status && status.isActive) targetRoom.SetPositionScale(1.0f / status.proximityRadius);
}
}

private IEnumerator UpdatePositionRoutine()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,10 @@ IEnumerator Start()
while (!OdinHandler.Instance)
yield return null;

Debug.Log("Odin Handler now available.");
Debug.Log("Odin Handler is now available.");

yield return null;
yield return null;
// Important: We have to disperse the Join Room Calls over multiple frames. If called in the same frame, build will crash.
// yield return null;
// yield return null;
foreach (OdinStringVariable refRoomName in refRoomNames)
{
if (OdinHandler.Instance && !OdinHandler.Instance.Rooms.Contains(refRoomName.Value))
Expand All @@ -44,8 +43,6 @@ IEnumerator Start()

OdinSampleUserData userData = new OdinSampleUserData(refPlayerName.Value);
OdinHandler.Instance.JoinRoom(refRoomName.Value, userData);

// yield return null;
}
}
}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion ODIN-SampleProject/Packages/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"com.unity.ide.rider": "3.0.15",
"com.unity.ide.visualstudio": "2.0.16",
"com.unity.ide.vscode": "1.2.5",
"com.unity.inputsystem": "1.3.0",
"com.unity.inputsystem": "1.4.1",
"com.unity.mobile.android-logcat": "1.3.2",
"com.unity.test-framework": "1.1.31",
"com.unity.textmeshpro": "3.0.6",
Expand Down
2 changes: 1 addition & 1 deletion ODIN-SampleProject/Packages/packages-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"url": "https://packages.unity.com"
},
"com.unity.inputsystem": {
"version": "1.3.0",
"version": "1.4.1",
"depth": 0,
"source": "registry",
"dependencies": {
Expand Down
35 changes: 18 additions & 17 deletions ODIN-SampleProject/ProjectSettings/ProjectSettings.asset
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ PlayerSettings:
16:10: 1
16:9: 1
Others: 1
bundleVersion: 0.18.0
bundleVersion: 0.18.1
preloadedAssets:
- {fileID: 0}
- {fileID: 0}
Expand Down Expand Up @@ -163,7 +163,7 @@ PlayerSettings:
Standalone: 0
iPhone: 0
tvOS: 0
overrideDefaultApplicationIdentifier: 1
overrideDefaultApplicationIdentifier: 0
AndroidBundleVersionCode: 1
AndroidMinSdkVersion: 22
AndroidTargetSdkVersion: 0
Expand Down Expand Up @@ -423,8 +423,8 @@ PlayerSettings:
m_GraphicsJobMode: 0
m_BuildTargetGraphicsAPIs:
- m_BuildTarget: AndroidPlayer
m_APIs: 150000000b000000
m_Automatic: 1
m_APIs: 0b00000008000000
m_Automatic: 0
- m_BuildTarget: iOSSupport
m_APIs: 10000000
m_Automatic: 1
Expand Down Expand Up @@ -700,21 +700,22 @@ PlayerSettings:
webGLThreadsSupport: 0
webGLDecompressionFallback: 0
scriptingDefineSymbols:
Android: UNITY_POST_PROCESSING_STACK_V2;PHOTON_UNITY_NETWORKING;PUN_2_0_OR_NEWER;PUN_2_OR_NEWER;PUN_2_19_OR_NEWER
CloudRendering: UNITY_POST_PROCESSING_STACK_V2;PHOTON_UNITY_NETWORKING;PUN_2_0_OR_NEWER;PUN_2_OR_NEWER;PUN_2_19_OR_NEWER
: UNITY_POST_PROCESSING_STACK_V2;PHOTON_UNITY_NETWORKING;PUN_2_0_OR_NEWER;PUN_2_OR_NEWER;PUN_2_19_OR_NEWER
Android: PHOTON_UNITY_NETWORKING;PUN_2_0_OR_NEWER;PUN_2_OR_NEWER;PUN_2_19_OR_NEWER
GameCoreScarlett: PHOTON_UNITY_NETWORKING;PUN_2_0_OR_NEWER;PUN_2_OR_NEWER;PUN_2_19_OR_NEWER
GameCoreXboxOne: UNITY_POST_PROCESSING_STACK_V2;PHOTON_UNITY_NETWORKING;PUN_2_0_OR_NEWER;PUN_2_OR_NEWER;PUN_2_19_OR_NEWER
Lumin: UNITY_POST_PROCESSING_STACK_V2;PHOTON_UNITY_NETWORKING;PUN_2_0_OR_NEWER;PUN_2_OR_NEWER;PUN_2_19_OR_NEWER
Nintendo Switch: UNITY_POST_PROCESSING_STACK_V2;PHOTON_UNITY_NETWORKING;PUN_2_0_OR_NEWER;PUN_2_OR_NEWER;PUN_2_19_OR_NEWER
PS4: UNITY_POST_PROCESSING_STACK_V2;PHOTON_UNITY_NETWORKING;PUN_2_0_OR_NEWER;PUN_2_OR_NEWER;PUN_2_19_OR_NEWER
PS5: UNITY_POST_PROCESSING_STACK_V2;PHOTON_UNITY_NETWORKING;PUN_2_0_OR_NEWER;PUN_2_OR_NEWER;PUN_2_19_OR_NEWER
Stadia: UNITY_POST_PROCESSING_STACK_V2;PHOTON_UNITY_NETWORKING;PUN_2_0_OR_NEWER;PUN_2_OR_NEWER;PUN_2_19_OR_NEWER
Standalone: UNITY_POST_PROCESSING_STACK_V2;PHOTON_UNITY_NETWORKING;PUN_2_0_OR_NEWER;PUN_2_OR_NEWER;PUN_2_19_OR_NEWER
WebGL: UNITY_POST_PROCESSING_STACK_V2;PHOTON_UNITY_NETWORKING;PUN_2_0_OR_NEWER;PUN_2_OR_NEWER;PUN_2_19_OR_NEWER
Windows Store Apps: UNITY_POST_PROCESSING_STACK_V2;PHOTON_UNITY_NETWORKING;PUN_2_0_OR_NEWER;PUN_2_OR_NEWER;PUN_2_19_OR_NEWER
XboxOne: UNITY_POST_PROCESSING_STACK_V2;PHOTON_UNITY_NETWORKING;PUN_2_0_OR_NEWER;PUN_2_OR_NEWER;PUN_2_19_OR_NEWER
GameCoreXboxOne: PHOTON_UNITY_NETWORKING;PUN_2_0_OR_NEWER;PUN_2_OR_NEWER;PUN_2_19_OR_NEWER
LinuxHeadlessSimulation: PHOTON_UNITY_NETWORKING;PUN_2_0_OR_NEWER;PUN_2_OR_NEWER;PUN_2_19_OR_NEWER
Lumin: PHOTON_UNITY_NETWORKING;PUN_2_0_OR_NEWER;PUN_2_OR_NEWER;PUN_2_19_OR_NEWER
Nintendo Switch: PHOTON_UNITY_NETWORKING;PUN_2_0_OR_NEWER;PUN_2_OR_NEWER;PUN_2_19_OR_NEWER
PS4: PHOTON_UNITY_NETWORKING;PUN_2_0_OR_NEWER;PUN_2_OR_NEWER;PUN_2_19_OR_NEWER
PS5: PHOTON_UNITY_NETWORKING;PUN_2_0_OR_NEWER;PUN_2_OR_NEWER;PUN_2_19_OR_NEWER
Stadia: PHOTON_UNITY_NETWORKING;PUN_2_0_OR_NEWER;PUN_2_OR_NEWER;PUN_2_19_OR_NEWER
Standalone: PHOTON_UNITY_NETWORKING;PUN_2_0_OR_NEWER;PUN_2_OR_NEWER;PUN_2_19_OR_NEWER
WebGL: PHOTON_UNITY_NETWORKING;PUN_2_0_OR_NEWER;PUN_2_OR_NEWER;PUN_2_19_OR_NEWER
Windows Store Apps: PHOTON_UNITY_NETWORKING;PUN_2_0_OR_NEWER;PUN_2_OR_NEWER;PUN_2_19_OR_NEWER
XboxOne: PHOTON_UNITY_NETWORKING;PUN_2_0_OR_NEWER;PUN_2_OR_NEWER;PUN_2_19_OR_NEWER
iPhone: PHOTON_UNITY_NETWORKING;PUN_2_0_OR_NEWER;PUN_2_OR_NEWER;PUN_2_19_OR_NEWER
tvOS: UNITY_POST_PROCESSING_STACK_V2;PHOTON_UNITY_NETWORKING;PUN_2_0_OR_NEWER;PUN_2_OR_NEWER;PUN_2_19_OR_NEWER
tvOS: PHOTON_UNITY_NETWORKING;PUN_2_0_OR_NEWER;PUN_2_OR_NEWER;PUN_2_19_OR_NEWER
additionalCompilerArguments: {}
platformArchitecture: {}
scriptingBackend:
Expand Down
4 changes: 2 additions & 2 deletions ODIN-SampleProject/ProjectSettings/ProjectVersion.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
m_EditorVersion: 2021.3.6f1
m_EditorVersionWithRevision: 2021.3.6f1 (7da38d85baf6)
m_EditorVersion: 2021.3.9f1
m_EditorVersionWithRevision: 2021.3.9f1 (ad3870b89536)

0 comments on commit 93fd857

Please sign in to comment.