Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into feature/snap-ghosts
Browse files Browse the repository at this point in the history
  • Loading branch information
andybak committed Jan 13, 2025
2 parents 7467a1b + 7452de9 commit be37892
Show file tree
Hide file tree
Showing 205 changed files with 26,594 additions and 3,033 deletions.
1 change: 1 addition & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ indent_size = 2
[*.{cs,py}]
indent_style = space
indent_size = 4
end_of_line = lf

# Microsoft .NET properties
csharp_new_line_before_members_in_object_initializers = false
Expand Down
4 changes: 4 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@ updates:
- "mikeage"
assignees:
- "mikeage"
groups:
all-actions-updates:
patterns:
- "**"
188 changes: 102 additions & 86 deletions .github/workflows/build.yml

Large diffs are not rendered by default.

23 changes: 20 additions & 3 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,27 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5.1.0
- uses: actions/setup-python@v5.3.0
with:
python-version: '3.12'
- uses: actions/setup-dotnet@v4.0.0
- uses: actions/setup-dotnet@v4.1.0
with:
dotnet-version: '8.0.x'
- uses: pre-commit/[email protected]
- name: Install pre-commit
run: python -m pip install pre-commit
shell: bash
- name: Cache pre-commit environments
uses: actions/cache@v4
with:
path: ~/.cache/pre-commit
key: pre-commit-3|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }}
- name: Setup pre-commit environments
run: pre-commit run
- name: Run pre-commit dotnet-format, with retries
uses: Wandalen/wretry.action@v3
with:
command: pre-commit run dotnet-format --show-diff-on-failure --color=always --all-files || { git checkout -- . ; exit 1 ; } # In case dotnet-format fails, reset the changes it made. This way, we can differentiate between a NuGet failure and a real formatting issue
- name: Remove dotnet-format from the list of pre-commit jobs to run (since we already ran it)
run: yq eval 'del(.repos[] | select(.hooks[].id == "dotnet-format"))' -i .pre-commit-config.yaml
- name: Run the rest of pre-commit
run: pre-commit run --show-diff-on-failure --color=always --all-files
4 changes: 2 additions & 2 deletions .github/workflows/test_unity_credentials.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ on:
workflow_dispatch:

env:
UNITY_VERSION: "2019.4.25f1"
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_VERSION: "2021.3.30f1"
UNITY_EMAIL: ${{ vars.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/third_party_notices.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5.1.0
- uses: actions/setup-python@v5.3.0
with:
python-version: '3.12'
- name: Run the generator
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ Packages/com.unity.xr.picoxr
/Assets/Photon/**
/Assets/Photon.meta
!/Assets/Photon/Fusion/Resources/NetworkProjectConfig.fusion*
!/Assets/Photon/Fusion/Resources/PhotonAppSettings.asset*
!/Assets/Photon/Fusion/User/NetworkPrefabAssetCollection.asset*

# Cache files
*.cache
1 change: 1 addition & 0 deletions .yamlfmt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
line_ending: lf
formatter:
include_document_start: true
indent: 2
Expand Down
8 changes: 4 additions & 4 deletions Assets/Editor/BuildTiltBrush.cs
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,7 @@ static void CommandLine()
// Call these once to create the files. Normally (i.e., in a GUI build), they're created with
// [UnityEditor.InitializeOnLoad], but in case they're missing, like in CI, make sure they're
// there!
OVRProjectConfig defaultOculusProjectConfig = OVRProjectConfig.GetProjectConfig();
OVRProjectConfig defaultOculusProjectConfig = OVRProjectConfig.CachedProjectConfig;
string useless_app_id = Assets.Oculus.VR.Editor.OVRPlatformToolSettings.AppID;
#endif

Expand Down Expand Up @@ -1032,7 +1032,7 @@ public TempSetAppNames(BuildTarget target, string Description)
#endif
if (!String.IsNullOrEmpty(Description))
{
new_name += "-(" + Description + ")";
new_name += "-(" + Description.Replace("#", "") + ")";
new_identifier += "-" + Description.Replace("_", "").Replace("#", "").Replace("-", "");
}
if (m_IsAndroidOrIos)
Expand Down Expand Up @@ -1435,7 +1435,7 @@ static void ShowBrushExportTextures()
using (var unused = new TempHookUpSingletons())
{
// Set consultUserConfig = false to keep user config from affecting the build output.
TiltBrushManifest manifest = App.Instance.GetMergedManifest(forceExperimental: true);
TiltBrushManifest manifest = App.Instance.ManifestFull;

StringBuilder s = new StringBuilder();
foreach (BrushDescriptor desc in manifest.UniqueBrushes())
Expand Down Expand Up @@ -1547,7 +1547,7 @@ public static void DoBuild(TiltBuildOptions tiltOptions)
// to be run at build-time (ie when nobody has called Start(), Awake()).
// TempHookupSingletons() has done just enough initialization to make it happy.
// Also set consultUserConfig = false to keep user config from affecting the build output.
TiltBrushManifest manifest = App.Instance.GetMergedManifest(forceExperimental: true);
TiltBrushManifest manifest = App.Instance.ManifestFull;

// Some sanity checks
{
Expand Down
13 changes: 13 additions & 0 deletions Assets/Editor/BuildTiltBrushPostProcess.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,19 @@ public void OnPostGenerateGradleAndroidProject(string path)
);
#endif

#if ENABLE_CONTEXTUAL_BOUNDARYLESS_APP
UnityEngine.Debug.Log("Add com.oculus.feature.CONTEXTUAL_BOUNDARYLESS_APP");
AddOrRemoveTag(doc,
androidNamespaceURI,
"/manifest",
"uses-feature",
"com.oculus.feature.CONTEXTUAL_BOUNDARYLESS_APP",
true,
true,
"required", "true"
);
#endif

#if FORCE_HEADTRACKING
UnityEngine.Debug.Log("Add android.hardware.vr.headtracking");
AddOrRemoveTag(doc,
Expand Down
189 changes: 189 additions & 0 deletions Assets/Editor/MultiplayerManagerEditor.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,189 @@
// MultiplayerManagerInspector.cs
using UnityEditor;
using UnityEngine;
using OpenBrush.Multiplayer;
using System.Threading.Tasks;
using System.ComponentModel.Composition;

#if UNITY_EDITOR
[CustomEditor(typeof(MultiplayerManager))]
public class MultiplayerManagerInspector : Editor
{
private MultiplayerManager multiplayerManager;
private string roomName = "1234";
private bool isPrivate = false;
private int maxPlayers = 4;
private bool voiceDisabled = false;

public override void OnInspectorGUI()
{
multiplayerManager = (MultiplayerManager)target;

DrawDefaultInspector();

GUILayout.Space(10);
EditorGUILayout.LabelField("", GUI.skin.horizontalSlider);
GUILayout.Space(10);

roomName = EditorGUILayout.TextField("Room Name", roomName);

//State
string connectionState = "";
if (multiplayerManager != null) connectionState = multiplayerManager.State.ToString();
else connectionState = "Not Assigned";

GUILayout.Space(10);
EditorGUILayout.LabelField("", GUI.skin.horizontalSlider);
EditorGUILayout.BeginHorizontal();
GUILayout.Label("Connection State: ", EditorStyles.boldLabel);
EditorGUILayout.LabelField($"{connectionState}");
EditorGUILayout.EndHorizontal();
GUILayout.Space(5);

if (GUILayout.Button("Connect"))
{
ConnectToLobby();
EditorUtility.SetDirty(target);
}


if (GUILayout.Button("Join Room"))
{
ConnectToRoom();
EditorUtility.SetDirty(target);
}


if (GUILayout.Button("Exit Room"))
{
DisconnectFromRoom();
EditorUtility.SetDirty(target);
}


if (GUILayout.Button("Disconnect"))
{
Disconnect();
EditorUtility.SetDirty(target);
}

if (GUILayout.Button("Refresh Room List"))
{
CheckIfRoomExists();
EditorUtility.SetDirty(target);
}

//Local Player Id
string localPlayerId = "";
if (multiplayerManager.m_LocalPlayer != null) localPlayerId = multiplayerManager.m_LocalPlayer.PlayerId.ToString();
else localPlayerId = "Not Assigned";

GUILayout.Space(10);
EditorGUILayout.LabelField("", GUI.skin.horizontalSlider);
EditorGUILayout.BeginHorizontal();
GUILayout.Label("Local Player ID: ", EditorStyles.boldLabel);
EditorGUILayout.LabelField($"{localPlayerId}");
EditorGUILayout.EndHorizontal();

//Room Ownership
string ownership = "";
if (multiplayerManager != null && multiplayerManager.IsUserRoomOwner()) ownership = "Yes";
else if (multiplayerManager != null && !multiplayerManager.IsUserRoomOwner()) ownership = "No";
else ownership = "Not Assigned";

EditorGUILayout.BeginHorizontal();
GUILayout.Label("Is Local Player Room Owner:", EditorStyles.boldLabel);
EditorGUILayout.LabelField($"{ownership}");
EditorGUILayout.EndHorizontal();

//Remote Users
string remoteUsersRegistered = "";
if (multiplayerManager.m_RemotePlayers != null && multiplayerManager.m_RemotePlayers.Count > 0)
{
remoteUsersRegistered = "UserIds:[ ";
foreach (var remotePlayer in multiplayerManager.m_RemotePlayers)
{
remoteUsersRegistered += remotePlayer.PlayerId.ToString() + ",";
}
remoteUsersRegistered += "]";
}
else remoteUsersRegistered = "Not Assigned";

//Registered remote players

EditorGUILayout.BeginHorizontal();
GUILayout.Label("Registered Remote Players IDs:", EditorStyles.boldLabel);
EditorGUILayout.LabelField($"{remoteUsersRegistered}");
EditorGUILayout.EndHorizontal();

// Display and edit Nickname
GUILayout.Space(10);
EditorGUILayout.LabelField("Nickname", GUI.skin.horizontalSlider);
string currentNickname = multiplayerManager.UserInfo.Nickname;
GUILayout.Label("Nickname", EditorStyles.boldLabel);
string newNickname = EditorGUILayout.TextField("Edit Nickname", currentNickname);
if (newNickname != currentNickname)
{
ConnectionUserInfo updatedUserInfo = multiplayerManager.UserInfo;
updatedUserInfo.Nickname = newNickname;
multiplayerManager.UserInfo = updatedUserInfo;
EditorUtility.SetDirty(target); // Mark the target as dirty to apply changes
}


Repaint();

}

private async void ConnectToLobby()
{
if (multiplayerManager != null)
{
bool success = await multiplayerManager.Connect();
}
}

private async void ConnectToRoom()
{
if (multiplayerManager != null)
{
RoomCreateData roomData = new RoomCreateData
{
roomName = roomName,
@private = isPrivate,
maxPlayers = maxPlayers,
voiceDisabled = voiceDisabled
};

bool success = await multiplayerManager.JoinRoom(roomData);

}
}

private async void DisconnectFromRoom()
{
if (multiplayerManager != null)
{
bool success = await multiplayerManager.LeaveRoom();

}
}

private async void Disconnect()
{
if (multiplayerManager != null)
{
bool success = await multiplayerManager.Disconnect();

}
}

private void CheckIfRoomExists()
{
if (multiplayerManager != null)
{
bool roomExists = multiplayerManager.DoesRoomNameExist(roomName);
}
}
}
#endif
11 changes: 11 additions & 0 deletions Assets/Editor/MultiplayerManagerEditor.cs.meta

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

3 changes: 2 additions & 1 deletion Assets/InputSystem.inputsettings.asset
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ MonoBehaviour:
m_CompensateForScreenOrientation: 1
m_BackgroundBehavior: 0
m_EditorInputBehaviorInPlayMode: 0
m_InputActionPropertyDrawerMode: 0
m_DefaultDeadzoneMin: 0.125
m_DefaultDeadzoneMax: 0.925
m_DefaultButtonPressPoint: 0.125
m_DefaultButtonPressPoint: 0.05
m_ButtonReleaseThreshold: 1
m_DefaultTapTime: 0.2
m_DefaultSlowTapTime: 0.5
Expand Down
11 changes: 7 additions & 4 deletions Assets/Oculus/OculusProjectConfig.asset
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,11 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 05d394ae2a81edd4cbc3c51917e766e3, type: 3}
m_Name: OculusProjectConfig
m_EditorClassIdentifier:
targetDeviceTypes: 0100000002000000
targetDeviceTypes: 01000000020000000300000004000000
allowOptional3DofHeadTracking: 0
handTrackingSupport: 0
handTrackingFrequency: 0
handTrackingVersion: 0
multimodalHandsControllersSupport: 0
anchorSupport: 1
sharedAnchorSupport: 1
renderModelSupport: 0
Expand All @@ -27,16 +26,20 @@ MonoBehaviour:
eyeTrackingSupport: 0
virtualKeyboardSupport: 0
sceneSupport: 1
boundaryVisibilitySupport: 0
disableBackups: 0
enableNSCConfig: 0
securityXmlPath:
skipUnneededShaders: 0
enableIL2CPPLTO: 0
focusAware: 1
requiresSystemKeyboard: 0
experimentalFeaturesEnabled: 0
insightPassthroughEnabled: 0
_insightPassthroughSupport: 1
_processorFavor: 0
systemSplashScreen: {fileID: 0}
systemSplashScreenType: 0
ovrPluginMd5Win64: 67e58deb5b905ae742512bbee3e06a70
ovrPluginMd5Android: 017d859ada160e45b27588f910d5d8d8
_systemLoadingScreenBackground: 0
ovrPluginMd5Win64: d72fb658f3d9064293fb2241e55259057f9ac34a260fafcf32f36c4a3005911c
ovrPluginMd5Android: 5ef6da3aad630673da6447f50e1b2d8ae14dbda69fd9877bc13b87ed87f3752b
Loading

0 comments on commit be37892

Please sign in to comment.