狗屎Minimax坏我代码
This commit is contained in:
@@ -1,9 +1,6 @@
|
||||
using System.IO;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using SickscoreGames;
|
||||
|
||||
namespace SickscoreGames.HUDNavigationSystem
|
||||
{
|
||||
|
||||
@@ -15,6 +15,6 @@ AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 103056
|
||||
packageName: HUD Navigation System
|
||||
packageVersion: 2.2.0
|
||||
assetPath: Assets/Sickscore Games/HUD-Navigation-System/Scripts/Utilities/Editor/HNSDocumentation.cs
|
||||
uploadId: 382610
|
||||
packageVersion: 3.0.0
|
||||
assetPath: Assets/OtherPlugins/HUD-Navigation-System/Scripts/Utilities/Editor/HNSDocumentation.cs
|
||||
uploadId: 884440
|
||||
|
||||
@@ -1,12 +1,7 @@
|
||||
using System.Linq;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using UnityEngine;
|
||||
#if UNITY_EDITOR
|
||||
using UnityEditor;
|
||||
#endif
|
||||
using SickscoreGames;
|
||||
|
||||
namespace SickscoreGames.HUDNavigationSystem
|
||||
{
|
||||
@@ -42,7 +37,7 @@ namespace SickscoreGames.HUDNavigationSystem
|
||||
#region Utility Methods
|
||||
private static void CheckInstance<T> (int instanceId, Rect selectionRect, string iconName) where T : UnityEngine.Object
|
||||
{
|
||||
GameObject go = EditorUtility.InstanceIDToObject(instanceId) as GameObject;
|
||||
GameObject go = HUDNavigationExtensions.EntityOrInstanceIdToObject(instanceId) as GameObject;
|
||||
if (go == null) return;
|
||||
if (go.GetComponent<T> () != null)
|
||||
DrawIcon(iconName, selectionRect);
|
||||
|
||||
@@ -13,6 +13,6 @@ AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 103056
|
||||
packageName: HUD Navigation System
|
||||
packageVersion: 2.2.0
|
||||
assetPath: Assets/Sickscore Games/HUD-Navigation-System/Scripts/Utilities/Editor/HNSEditorIcons.cs
|
||||
uploadId: 382610
|
||||
packageVersion: 3.0.0
|
||||
assetPath: Assets/OtherPlugins/HUD-Navigation-System/Scripts/Utilities/Editor/HNSEditorIcons.cs
|
||||
uploadId: 884440
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace SickscoreGames.HUDNavigationSystem
|
||||
{
|
||||
[CustomEditor(typeof(HNSTextReference))]
|
||||
public class HNSTextReferenceEditor : HUDNavigationBaseEditor
|
||||
{
|
||||
#region Variables
|
||||
|
||||
protected HNSTextReference hudTarget;
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region Main Methods
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
editorTitle = "HNS Text Reference";
|
||||
splashTexture = (Texture2D)Resources.Load("Textures/splashTexture_TextReference", typeof(Texture2D));
|
||||
showExpandButton = false;
|
||||
|
||||
hudTarget = (HNSTextReference)target;
|
||||
}
|
||||
|
||||
protected override void OnBaseInspectorGUI()
|
||||
{
|
||||
// update serialized object
|
||||
serializedObject.Update();
|
||||
|
||||
// get the text adapter
|
||||
var adapter = hudTarget.GetAdapter();
|
||||
|
||||
// cache serialized properties
|
||||
SerializedProperty _pTextComponent = serializedObject.FindProperty("_textComponent");
|
||||
|
||||
EditorGUILayout.PropertyField(_pTextComponent, new GUIContent("Text Component", "The text component which will get updated"));
|
||||
EditorGUILayout.LabelField("Adapter", adapter?.GetType().Name ?? "<none>");
|
||||
|
||||
if (adapter == null)
|
||||
{
|
||||
EditorGUILayout.Space();
|
||||
|
||||
if (hudTarget.GetTextComponent() != null)
|
||||
EditorGUILayout.HelpBox("Assigned component is not a valid text adapter.", MessageType.Error);
|
||||
else
|
||||
EditorGUILayout.HelpBox("No supported text component detected.", MessageType.Warning);
|
||||
|
||||
if (!Application.isPlaying)
|
||||
{
|
||||
if (GUILayout.Button("Refresh"))
|
||||
{
|
||||
hudTarget.ForceInitialize();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// apply modified properties
|
||||
serializedObject.ApplyModifiedProperties ();
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3624fe1881f44ed59e430ff886406935
|
||||
timeCreated: 1773743684
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 103056
|
||||
packageName: HUD Navigation System
|
||||
packageVersion: 3.0.0
|
||||
assetPath: Assets/OtherPlugins/HUD-Navigation-System/Scripts/Utilities/Editor/HNSTextReferenceEditor.cs
|
||||
uploadId: 884440
|
||||
@@ -1,11 +1,5 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Text.RegularExpressions;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using UnityEngine.Serialization;
|
||||
#if UNITY_EDITOR
|
||||
using UnityEditor;
|
||||
using UnityEditor.IMGUI.Controls;
|
||||
|
||||
@@ -15,6 +15,6 @@ AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 103056
|
||||
packageName: HUD Navigation System
|
||||
packageVersion: 2.2.0
|
||||
assetPath: Assets/Sickscore Games/HUD-Navigation-System/Scripts/Utilities/Editor/HNSTextureCreatorEditor.cs
|
||||
uploadId: 382610
|
||||
packageVersion: 3.0.0
|
||||
assetPath: Assets/OtherPlugins/HUD-Navigation-System/Scripts/Utilities/Editor/HNSTextureCreatorEditor.cs
|
||||
uploadId: 884440
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using SickscoreGames;
|
||||
|
||||
namespace SickscoreGames.HUDNavigationSystem
|
||||
{
|
||||
@@ -90,14 +87,14 @@ namespace SickscoreGames.HUDNavigationSystem
|
||||
return;
|
||||
|
||||
// add hud navigation system to scene
|
||||
HUDNavigationSystem hudSystem = GameObject.FindObjectOfType<HUDNavigationSystem> ();
|
||||
HUDNavigationSystem hudSystem = HUDNavigationExtensions.FindFirst<HUDNavigationSystem> ();
|
||||
if (hudSystem == null) {
|
||||
GameObject hnsGO = new GameObject("[HUD Navigation System]");
|
||||
hudSystem = hnsGO.AddComponent<HUDNavigationSystem> ();
|
||||
}
|
||||
|
||||
// add scene manager to scene
|
||||
HUDNavigationSceneManager sceneManager = GameObject.FindObjectOfType<HUDNavigationSceneManager> ();
|
||||
HUDNavigationSceneManager sceneManager = HUDNavigationExtensions.FindFirst<HUDNavigationSceneManager> ();
|
||||
if (sceneManager == null)
|
||||
hudSystem.gameObject.AddComponent<HUDNavigationSceneManager> ();
|
||||
|
||||
@@ -106,7 +103,7 @@ namespace SickscoreGames.HUDNavigationSystem
|
||||
hudSystem.PlayerCamera = goCamera;
|
||||
|
||||
// add hud navigation canvas to scene
|
||||
HUDNavigationCanvas hudCanvas = GameObject.FindObjectOfType<HUDNavigationCanvas> ();
|
||||
HUDNavigationCanvas hudCanvas = HUDNavigationExtensions.FindFirst<HUDNavigationCanvas> ();
|
||||
if (hudCanvas == null) {
|
||||
// add canvas prefab from assets to scene
|
||||
GameObject hudPrefab = Resources.Load ("Prefabs/HUD Navigation Canvas") as GameObject;
|
||||
|
||||
@@ -15,6 +15,6 @@ AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 103056
|
||||
packageName: HUD Navigation System
|
||||
packageVersion: 2.2.0
|
||||
assetPath: Assets/Sickscore Games/HUD-Navigation-System/Scripts/Utilities/Editor/HUDNavigationSystem_QSWindow.cs
|
||||
uploadId: 382610
|
||||
packageVersion: 3.0.0
|
||||
assetPath: Assets/OtherPlugins/HUD-Navigation-System/Scripts/Utilities/Editor/HUDNavigationSystem_QSWindow.cs
|
||||
uploadId: 884440
|
||||
|
||||
Reference in New Issue
Block a user