Skip to content

Commit

Permalink
Add parrelsync for quick multiplayer tests (#1452)
Browse files Browse the repository at this point in the history
* add parrelsync

* parrelsync replace application data path with full path

* fix return forgot

* modify clone ckey and clone full game path

* update assembly references

* update to make build work

* fix attempt
  • Loading branch information
stilnat authored Sep 9, 2024
1 parent 320e2ba commit 0dae360
Show file tree
Hide file tree
Showing 42 changed files with 1,948 additions and 27 deletions.
16 changes: 0 additions & 16 deletions Assets/Content/Addressables/AssetGroups/Scenes.asset
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,6 @@ MonoBehaviour:
m_SerializedData: []
m_GUID: e18ea8489b90bd7488de5c242bac11c6
m_SerializeEntries:
- m_GUID: 61687ab4465bb6e4d8164057bedc63db
m_Address: Assets/Content/Scenes/Intro.unity
m_ReadOnly: 0
m_SerializedLabels: []
- m_GUID: c7d05c35cd4853643a09333ecceff608
m_Address: Assets/Content/Scenes/Game.unity
m_ReadOnly: 0
m_SerializedLabels: []
- m_GUID: 9fc0d4010bbf28b4594072e72b8655ab
m_Address: Assets/Content/Scenes/Boot.unity
m_ReadOnly: 0
m_SerializedLabels: []
- m_GUID: a7a0fb29f301d364a822be64003a90cb
m_Address: Assets/Content/Scenes/Empty.unity
m_ReadOnly: 0
m_SerializedLabels: []
- m_GUID: d03a300180bde5646b09bfa4c392679f
m_Address: Assets/Content/Scenes/Launcher.unity
m_ReadOnly: 0
Expand Down
8 changes: 8 additions & 0 deletions Assets/Scripts/External/ParrelSync.meta

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

8 changes: 8 additions & 0 deletions Assets/Scripts/External/ParrelSync/Editor.meta

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

8 changes: 8 additions & 0 deletions Assets/Scripts/External/ParrelSync/Editor/AssetModBlock.meta

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

Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using UnityEditor;
namespace ParrelSync
{
[InitializeOnLoad]
public class EditorQuit
{
/// <summary>
/// Is editor being closed
/// </summary>
static public bool IsQuiting { get; private set; }
static void Quit()
{
IsQuiting = true;
}

static EditorQuit()
{
IsQuiting = false;
EditorApplication.quitting += Quit;
}
}
}

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

Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
using UnityEditor;
using UnityEngine;
namespace ParrelSync
{
/// <summary>
/// For preventing assets being modified from the clone instance.
/// </summary>
public class ParrelSyncAssetModificationProcessor : UnityEditor.AssetModificationProcessor
{
public static string[] OnWillSaveAssets(string[] paths)
{
if (ClonesManager.IsClone() && Preferences.AssetModPref.Value)
{
if (paths != null && paths.Length > 0 && !EditorQuit.IsQuiting)
{
EditorUtility.DisplayDialog(
ClonesManager.ProjectName + ": Asset modifications saving detected and blocked",
"Asset modifications saving are blocked in the clone instance. \n\n" +
"This is a clone of the original project. \n" +
"Making changes to asset files via the clone editor is not recommended. \n" +
"Please use the original editor window if you want to make changes to the project files.",
"ok"
);
foreach (var path in paths)
{
Debug.Log("Attempting to save " + path + " are blocked.");
}
}
return new string[0] { };
}
return paths;
}
}
}

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

Loading

0 comments on commit 0dae360

Please sign in to comment.