-
-
Notifications
You must be signed in to change notification settings - Fork 136
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add parrelsync for quick multiplayer tests (#1452)
* 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
Showing
42 changed files
with
1,948 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
22 changes: 22 additions & 0 deletions
22
Assets/Scripts/External/ParrelSync/Editor/AssetModBlock/EditorQuit.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
Assets/Scripts/External/ParrelSync/Editor/AssetModBlock/EditorQuit.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
34 changes: 34 additions & 0 deletions
34
.../Scripts/External/ParrelSync/Editor/AssetModBlock/ParrelSyncAssetModificationProcessor.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
...pts/External/ParrelSync/Editor/AssetModBlock/ParrelSyncAssetModificationProcessor.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.