mirror of
https://github.com/sinai-dev/UnityExplorer.git
synced 2025-01-03 16:13:25 +08:00
1.3
added buttons to change which of the active scenes you are inspecting
This commit is contained in:
parent
10ee2a837f
commit
e8b17d3583
@ -16,7 +16,7 @@ namespace Explorer
|
||||
|
||||
public const string ID = "com.sinai.cppexplorer";
|
||||
public const string NAME = "IL2CPP Runtime Explorer";
|
||||
public const string VERSION = "1.2.0";
|
||||
public const string VERSION = "1.3.0";
|
||||
public const string AUTHOR = "Sinai";
|
||||
|
||||
// fields
|
||||
|
@ -68,7 +68,7 @@ namespace Explorer
|
||||
}
|
||||
else
|
||||
{
|
||||
var scene = SceneManager.GetActiveScene();
|
||||
var scene = SceneManager.GetSceneByName(m_currentScene);
|
||||
var rootObjects = scene.GetRootGameObjects();
|
||||
|
||||
// add objects with children first
|
||||
@ -90,8 +90,39 @@ namespace Explorer
|
||||
{
|
||||
try
|
||||
{
|
||||
GUILayout.BeginHorizontal(null);
|
||||
// Current Scene label
|
||||
GUILayout.Label("Current Scene: <color=cyan>" + m_currentScene + "</color>", null);
|
||||
GUILayout.Label("Current Scene:", new GUILayoutOption[] { GUILayout.Width(120) });
|
||||
if (SceneManager.sceneCount > 1)
|
||||
{
|
||||
int changeWanted = 0;
|
||||
if (GUILayout.Button("<", new GUILayoutOption[] { GUILayout.Width(30) }))
|
||||
{
|
||||
changeWanted = -1;
|
||||
}
|
||||
if (GUILayout.Button(">", new GUILayoutOption[] { GUILayout.Width(30) }))
|
||||
{
|
||||
changeWanted = 1;
|
||||
}
|
||||
if (changeWanted != 0)
|
||||
{
|
||||
var scenes = SceneManager.GetAllScenes();
|
||||
int index = scenes.IndexOf(SceneManager.GetSceneByName(m_currentScene));
|
||||
index += changeWanted;
|
||||
if (index >= scenes.Count - 1)
|
||||
{
|
||||
index = 0;
|
||||
}
|
||||
else if (index > 0)
|
||||
{
|
||||
index = scenes.Count - 1;
|
||||
}
|
||||
m_currentScene = scenes[index].name;
|
||||
}
|
||||
}
|
||||
GUILayout.Label("<color=cyan>" + m_currentScene + "</color>", null); //new GUILayoutOption[] { GUILayout.Width(250) });
|
||||
|
||||
GUILayout.EndHorizontal();
|
||||
|
||||
// ----- GameObject Search -----
|
||||
GUILayout.BeginHorizontal(GUI.skin.box, null);
|
||||
@ -207,7 +238,7 @@ namespace Explorer
|
||||
|
||||
foreach (var obj in Resources.FindObjectsOfTypeAll<GameObject>())
|
||||
{
|
||||
if (obj.name.ToLower().Contains(_search.ToLower()) && obj.scene.name == CppExplorer.ActiveSceneName)
|
||||
if (obj.name.ToLower().Contains(_search.ToLower()) && obj.scene.name == m_currentScene)
|
||||
{
|
||||
matches.Add(obj);
|
||||
}
|
||||
|
@ -16,7 +16,7 @@ namespace Explorer
|
||||
|
||||
public const string ID = "com.sinai.cppexplorer";
|
||||
public const string NAME = "IL2CPP Runtime Explorer";
|
||||
public const string VERSION = "1.2.0";
|
||||
public const string VERSION = "1.3.0";
|
||||
public const string AUTHOR = "Sinai";
|
||||
|
||||
// fields
|
||||
|
@ -68,7 +68,7 @@ namespace Explorer
|
||||
}
|
||||
else
|
||||
{
|
||||
var scene = SceneManager.GetActiveScene();
|
||||
var scene = SceneManager.GetSceneByName(m_currentScene);
|
||||
var rootObjects = scene.GetRootGameObjects();
|
||||
|
||||
// add objects with children first
|
||||
@ -90,8 +90,38 @@ namespace Explorer
|
||||
{
|
||||
try
|
||||
{
|
||||
GUILayout.BeginHorizontal(null);
|
||||
// Current Scene label
|
||||
GUILayout.Label("Current Scene: <color=cyan>" + m_currentScene + "</color>", null);
|
||||
GUILayout.Label("Current Scene:", new GUILayoutOption[] { GUILayout.Width(120) });
|
||||
if (SceneManager.sceneCount > 1)
|
||||
{
|
||||
int changeWanted = 0;
|
||||
if (GUILayout.Button("<", new GUILayoutOption[] { GUILayout.Width(30) }))
|
||||
{
|
||||
changeWanted = -1;
|
||||
}
|
||||
if (GUILayout.Button(">", new GUILayoutOption[] { GUILayout.Width(30) }))
|
||||
{
|
||||
changeWanted = 1;
|
||||
}
|
||||
if (changeWanted != 0)
|
||||
{
|
||||
var scenes = SceneManager.GetAllScenes();
|
||||
int index = scenes.IndexOf(SceneManager.GetSceneByName(m_currentScene));
|
||||
index += changeWanted;
|
||||
if (index >= scenes.Count - 1)
|
||||
{
|
||||
index = 0;
|
||||
}
|
||||
else if (index > 0)
|
||||
{
|
||||
index = scenes.Count - 1;
|
||||
}
|
||||
m_currentScene = scenes[index].name;
|
||||
}
|
||||
}
|
||||
GUILayout.Label("<color=cyan>" + m_currentScene + "</color>", null);
|
||||
GUILayout.EndHorizontal();
|
||||
|
||||
// ----- GameObject Search -----
|
||||
GUILayout.BeginHorizontal(GUI.skin.box, null);
|
||||
@ -207,7 +237,7 @@ namespace Explorer
|
||||
|
||||
foreach (var obj in Resources.FindObjectsOfTypeAll<GameObject>())
|
||||
{
|
||||
if (obj.name.ToLower().Contains(_search.ToLower()) && obj.scene.name == CppExplorer.ActiveSceneName)
|
||||
if (obj.name.ToLower().Contains(_search.ToLower()) && obj.scene.name == m_currentScene)
|
||||
{
|
||||
matches.Add(obj);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user