From bfc8a0bcdedc77969089411592da22dbe5381be8 Mon Sep 17 00:00:00 2001 From: Salman hayat <36339248+salmanhayat1998@users.noreply.github.com> Date: Wed, 2 Nov 2022 08:54:30 -0700 Subject: [PATCH] Revert "Merge branch 'main' of https://github.com/salmanhayat1998/Scenes-Navigator" This reverts commit d100c7253751e4004df7f3c1fe09e6d5e5fff79f, reversing changes made to dcfc7af237a562e4bc7ae1837d3aa0eb1142646c. --- .../Editor/ScenesWindow.cs | 52 ++++--------------- README.md | 18 ++----- 2 files changed, 15 insertions(+), 55 deletions(-) diff --git a/Assets/Scene Handler Editor/Editor/ScenesWindow.cs b/Assets/Scene Handler Editor/Editor/ScenesWindow.cs index c511136..d255c7b 100644 --- a/Assets/Scene Handler Editor/Editor/ScenesWindow.cs +++ b/Assets/Scene Handler Editor/Editor/ScenesWindow.cs @@ -1,48 +1,27 @@ -using System.Collections.Generic; +/// This script is created By Salman Hayat, is free to use and is available on Github +/// for any queries , contact at salmanhayat16@gmail.com +/// Github link: https://github.com/salmanhayat1998/Scenes-Navigator +/// Social link: https://www.linkedin.com/in/salmanhayat/ + +using System.Collections.Generic; using UnityEngine; using UnityEditor; using UnityEditor.SceneManagement; using UnityEngine.SceneManagement; using System.IO; -public class TestWindow : EditorWindow +public class ScenesWindow : EditorWindow { public List scenes = new List(); private EditorBuildSettingsScene[] EditroScenes; Vector2 scrollPos = Vector2.zero; static int assetno = 0; - float _w; - float _h; - float windowWidth - { - get - { - if (_w==0) - { - _w = GetWindow(false, "Project Scenes", true).position.width; - } - return _w; - } - } - float windowHeight - { - get - { - if (_h==0) - { - _h = GetWindow(false, "Project Scenes", true).position.height; - } - return _h; - } - } [MenuItem("Window/Scenes Holder")] public static void Open() { - TestWindow testWindow = GetWindow(false, "Project Scenes", true); - testWindow.Show(); - //width = testWindow.position.width; - //height = testWindow.position.height; + GetWindow(false, "Project Scenes", true); } + void OnGUI() { GUILayout.Label("Scenes Menu", EditorStyles.boldLabel); @@ -76,12 +55,11 @@ void OnGUI() if (scenes.Count > 0) { - scrollPos = EditorGUILayout.BeginScrollView(scrollPos, false, false, GUILayout.Width(windowWidth), GUILayout.Height(windowHeight - 120)); + scrollPos = EditorGUILayout.BeginScrollView(scrollPos, false, false, GUILayout.Width(EditorWindow.GetWindow(typeof(ScenesWindow)).position.width), GUILayout.Height(EditorWindow.GetWindow(typeof(ScenesWindow)).position.height - 120)); for (int i = 0; i < scenes.Count; i++) { EditorGUILayout.BeginHorizontal(); scenes[i] = EditorGUILayout.ObjectField(scenes[i], typeof(SceneAsset), true); - GUI.backgroundColor = Color.green; if (GUILayout.Button("Open")) { @@ -94,16 +72,6 @@ void OnGUI() EditorSceneManager.SaveCurrentModifiedScenesIfUserWantsTo(); EditorSceneManager.OpenScene(AssetDatabase.GetAssetPath(scenes[i]), OpenSceneMode.Additive); } - //if (EditorSceneManager.loadedSceneCount>1 ) - //{ - // // Debug.Log(EditorSceneManager.GetSceneManagerSetup().Length); - // GUI.backgroundColor = Color.yellow; - // if (GUILayout.Button("Unload")) - // { - // //EditorSceneManager.UnloadScene(AssetDatabase.GetAssetPath(scenes[i])); - // } - - //} GUI.backgroundColor = Color.red; Texture icon = Resources.Load("delicon") as Texture; if (GUILayout.Button(icon)) diff --git a/README.md b/README.md index 677e41c..16d18ff 100644 --- a/README.md +++ b/README.md @@ -4,20 +4,12 @@ A tool to place all your scenes and easily navigate between with a single click. ## How to Use: -1-Go to Windows>Scenes Holder. -2-press Get All build scenes button or Add scenes manually from your project. -3-Place the window anywhere in your project layout. +Go to Windows>Scenes Holder +press Get All build scenes button or Add scenes manually from your project. -### Tutorial: -https://youtu.be/xNuk0OEL09c +![2](https://user-images.githubusercontent.com/36339248/192696117-fcba9796-394e-42a6-aba8-5eb748171d77.png) -#### Get Scenes from build Settings: -![Get Build Scene](https://user-images.githubusercontent.com/36339248/199532169-e2916258-a1d5-45b6-a9d6-bc9f95bf5b52.png) +Boom! you are ready to go. -#### Open Scenes Additively: - -![Open Scene Additively](https://user-images.githubusercontent.com/36339248/199532410-32f8e931-28a1-4cec-84aa-5180b1f54755.png) - -#### Ask before switching: -![Add a heading](https://user-images.githubusercontent.com/36339248/199532442-16516e16-dfb6-4d83-aa15-1067b4b1958a.png) +![Untitled](https://user-images.githubusercontent.com/36339248/192695551-6609aec9-be44-4823-90eb-0c0c8c17ff25.png)