Commit 6ac7c452 authored by Tommé Nöll's avatar Tommé Nöll
Browse files

Merge branch 'tomme'

parents 8c4bd5d5 3e745c00
......@@ -9,8 +9,13 @@ using System.IO;
[InitializeOnLoad]
public class NotifyForLockedFiles : UnityEditor.AssetModificationProcessor
{
private static Scene realOldScene;
private static bool justActivated = true;
private static bool justReloaded = true;
static NotifyForLockedFiles()
{
//Debug.Log("Activate");
EditorSceneManager.activeSceneChangedInEditMode += CheckActivatedScene;
if (EditorSceneManager.GetActiveScene() != null)
{
......@@ -39,6 +44,25 @@ public class NotifyForLockedFiles : UnityEditor.AssetModificationProcessor
public static void CheckActivatedScene(Scene oldScene, Scene newScene)
{
bool wasJustActivated = justActivated;
bool wasJustReloaded = justReloaded;
//Debug.Log(oldScene.path + ", " + realOldScene.path + ", " + newScene.path + ", " + justActivated + ", " + justReloaded);
if (newScene.path != null && newScene.path.Length > 5)
justActivated = false;
if (oldScene.path == null || oldScene.path.Length < 5)
justReloaded = false;
if (oldScene == newScene) return;
if (wasJustActivated)
{
//Debug.Log("Starting Unity");
}
if (wasJustReloaded)
{
//Debug.Log("Reloading Level");
return;
}
//if (oldScene.path == null || oldScene.path.Length < 5) return;
realOldScene = newScene;
FileInfo info = new FileInfo(newScene.path);
if (info.IsReadOnly)
{
......
......@@ -67,7 +67,6 @@ public class VariableSoundPlayer : MonoBehaviour
{
if (activate)
{
Debug.Log(i + ", iCurrent: " + iCurrent);
if (iCurrent != i)
{
audioSource.clip = soundObjects[i].clip;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment