Essentials + extra crap
Loadings Startups Movement Camera
This commit is contained in:
1 parent
662f4a1d05
commit
5f5ace1b52
734 files changed
+107323
-1713
No files matched your search
+85
@@ -0,0 +1,85 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using ImmersiveVRTools.Editor.Common.Utilities;
|
||||
using ImmersiveVRTools.Runtime.Common;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace FastScriptReload.Editor.GUI
|
||||
{
|
||||
[InitializeOnLoad]
|
||||
public class ProjectWindowReloadStatusIndicatorDrawer
|
||||
{
|
||||
private static Texture HelpTexture;
|
||||
|
||||
private static bool IsEnabled;
|
||||
|
||||
|
||||
static ProjectWindowReloadStatusIndicatorDrawer()
|
||||
{
|
||||
EditorApplication.projectWindowItemOnGUI += ProjectWindowItemOnGUI;
|
||||
FastScriptReloadManager.Instance.HotReloadFailed += OnHotReloadFailed;
|
||||
EditorApplication.update += () =>
|
||||
{
|
||||
IsEnabled = (bool)FastScriptReloadPreference.IsVisualHotReloadIndicationShownInProjectWindow.GetEditorPersistedValueOrDefault();
|
||||
};
|
||||
}
|
||||
|
||||
private static void OnHotReloadFailed(List<DynamicFileHotReloadState> failedForFileStates)
|
||||
{
|
||||
if (!IsEnabled)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
UnityMainThreadDispatcher.Instance.Enqueue(() =>
|
||||
{
|
||||
var lastFailed = failedForFileStates.LastOrDefault();
|
||||
if (lastFailed != null)
|
||||
{
|
||||
var script = AssetDatabase.LoadAssetAtPath<MonoScript>(AssetDatabaseHelper.AbsolutePathToAssetPath(lastFailed.FullFileName));
|
||||
EditorGUIUtility.PingObject(script);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private static void ProjectWindowItemOnGUI(string guid, Rect rect)
|
||||
{
|
||||
if (!IsEnabled)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (HelpTexture == null)
|
||||
{
|
||||
HelpTexture = EditorGUIUtility.TrIconContent("_Help").image;
|
||||
}
|
||||
|
||||
if (FastScriptReloadManager.Instance.LastProcessedDynamicFileHotReloadStatesInSession.TryGetValue(guid, out var fileHotReloadState))
|
||||
{
|
||||
var sideLineRect = new Rect(1, rect.y, 2, rect.height);
|
||||
if (fileHotReloadState.IsFailed)
|
||||
{
|
||||
EditorGUI.DrawRect(sideLineRect, Color.red);
|
||||
|
||||
var sideInfoRect = new Rect(1, rect.y - 3, 20, 20);
|
||||
if (UnityEngine.GUI.Button(sideInfoRect,
|
||||
new GUIContent(new GUIContent(HelpTexture,
|
||||
@"Fast Script Reload - Error
|
||||
|
||||
Last hot reload failed.
|
||||
|
||||
Please click for more details.")),
|
||||
EditorStyles.linkLabel))
|
||||
{
|
||||
FastScriptReloadWelcomeScreen.Init().OpenInspectError(fileHotReloadState);
|
||||
};
|
||||
}
|
||||
else if (fileHotReloadState.IsChangeHotSwapped)
|
||||
{
|
||||
EditorGUI.DrawRect(sideLineRect, Color.green);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f4248f4ad21143d296208aa98ad3cfdf
|
||||
timeCreated: 1679048660
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 239351
|
||||
packageName: Fast Script Reload
|
||||
packageVersion: 1.6.1
|
||||
assetPath: Assets/FastScriptReload/Scripts/Editor/GUI/ProjectWindowReloadStatusIndicatorDrawer.cs
|
||||
uploadId: 710802
|
||||
Reference in new issue
Block a user