-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #87 from asadm/MockMode-V3
Mock Mode Updates
- Loading branch information
Showing
131 changed files
with
12,656 additions
and
635 deletions.
There are no files selected for viewing
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.
2 changes: 1 addition & 1 deletion
2
Assets/Editor/Src/Generator.meta → Assets/ParrelSync/Editor/AssetModBlock.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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; | ||
} | ||
} | ||
} |
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
Assets/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
Assets/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.