-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
505 additions
and
5,581 deletions.
There are no files selected for viewing
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,6 @@ | ||
{ | ||
"version": "1.0", | ||
"components": [ | ||
"Microsoft.VisualStudio.Workload.ManagedGame" | ||
] | ||
} |
Binary file not shown.
Binary file not shown.
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
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
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,107 @@ | ||
//#if UNITY_EDITOR | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
using UnityEditor; | ||
using UnityEditor.SceneManagement; | ||
|
||
using System.Reflection; | ||
|
||
public class SceneList : EditorWindow | ||
{ | ||
[MenuItem("Game/Scene List")] | ||
static public void Init() | ||
{ | ||
GetWindow<SceneList>().Show(); | ||
} | ||
|
||
public void Awake() | ||
{ | ||
Refresh(); | ||
} | ||
|
||
|
||
|
||
void Refresh() | ||
{ | ||
sceneList.Clear(); | ||
|
||
foreach (var bundle in ResourceManager.bundles) | ||
{ | ||
|
||
if (bundle is ResourceManager.UnityBundle unityBundle) | ||
{ | ||
//if (unityBundle.modName == "levels") | ||
{ | ||
foreach (var prefab in unityBundle.GetAllAssetNames()) | ||
{ | ||
if (prefab.Contains("/levels/") && prefab.Contains(".prefab")) | ||
{ | ||
sceneList.Add(prefab, false); | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
Dictionary<string, bool> sceneList = new Dictionary<string, bool>(); | ||
|
||
Vector2 listScrollPos = Vector2.zero; | ||
|
||
string filter = ""; | ||
|
||
public static void NotEditableTransform(GameObject go) | ||
{ | ||
for (int i = go.transform.childCount - 1; i >= 0; --i) | ||
{ | ||
NotEditableTransform(go.transform.GetChild(i).gameObject); | ||
} | ||
|
||
go.hideFlags |= HideFlags.NotEditable; | ||
} | ||
|
||
|
||
public void OnGUI() | ||
{ | ||
if (GUILayout.Button("[Refresh]")) | ||
{ | ||
Refresh(); | ||
} | ||
|
||
EditorGUILayout.BeginHorizontal(); | ||
filter = EditorGUILayout.TextField(filter); | ||
if(GUILayout.Button("[X]")) | ||
{ | ||
filter = ""; | ||
} | ||
EditorGUILayout.EndHorizontal(); | ||
//GUILayout.Space(20); | ||
|
||
listScrollPos = EditorGUILayout.BeginScrollView(listScrollPos); | ||
|
||
string filterLow = filter.ToLower(); | ||
foreach (var scene in sceneList) | ||
{ | ||
if (filter.Length == 0 || scene.Key.ToLower().Contains(filterLow)) | ||
{ | ||
if (GUILayout.Button(scene.Key)) | ||
{ | ||
var playInEditor = GameObject.FindObjectOfType<PlayInEditor>(); | ||
|
||
if(playInEditor == null) | ||
{ | ||
var goPIE = new GameObject("PlayInEditor"); | ||
playInEditor = goPIE.AddComponent<PlayInEditor>(); | ||
} | ||
|
||
playInEditor.spawnScene = scene.Key; | ||
playInEditor.SpawnScene(); | ||
} | ||
} | ||
} | ||
|
||
EditorGUILayout.EndScrollView(); | ||
} | ||
} | ||
//#endif |
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.