升级6.4.升级水,升级天气
This commit is contained in:
BIN
Assets/vTabs/Read me.pdf
Normal file
BIN
Assets/vTabs/Read me.pdf
Normal file
Binary file not shown.
7
Assets/vTabs/Read me.pdf.meta
Normal file
7
Assets/vTabs/Read me.pdf.meta
Normal file
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 01fbcccbc9a1a44c2bf42479f17dfb69
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
16
Assets/vTabs/VTabs.asmdef
Normal file
16
Assets/vTabs/VTabs.asmdef
Normal file
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"name": "VTabs",
|
||||
"rootNamespace": "",
|
||||
"references": [],
|
||||
"includePlatforms": [
|
||||
"Editor"
|
||||
],
|
||||
"excludePlatforms": [],
|
||||
"allowUnsafeCode": false,
|
||||
"overrideReferences": false,
|
||||
"precompiledReferences": [],
|
||||
"autoReferenced": true,
|
||||
"defineConstraints": [],
|
||||
"versionDefines": [],
|
||||
"noEngineReferences": false
|
||||
}
|
||||
7
Assets/vTabs/VTabs.asmdef.meta
Normal file
7
Assets/vTabs/VTabs.asmdef.meta
Normal file
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 06ab1c341392b4a318f67b84e0da6aab
|
||||
AssemblyDefinitionImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
1571
Assets/vTabs/VTabs.cs
Normal file
1571
Assets/vTabs/VTabs.cs
Normal file
File diff suppressed because it is too large
Load Diff
11
Assets/vTabs/VTabs.cs.meta
Normal file
11
Assets/vTabs/VTabs.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fc570418b0cd44cd49a39403a3ba1cf7
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
1220
Assets/vTabs/VTabsAddTabWindow.cs
Normal file
1220
Assets/vTabs/VTabsAddTabWindow.cs
Normal file
File diff suppressed because it is too large
Load Diff
11
Assets/vTabs/VTabsAddTabWindow.cs.meta
Normal file
11
Assets/vTabs/VTabsAddTabWindow.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 928f84418aa3c41649729951fe66405c
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
42
Assets/vTabs/VTabsCache.cs
Normal file
42
Assets/vTabs/VTabsCache.cs
Normal file
@@ -0,0 +1,42 @@
|
||||
#if UNITY_EDITOR
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using UnityEditor.ShortcutManagement;
|
||||
using System.Reflection;
|
||||
using System.Linq;
|
||||
using UnityEngine.UIElements;
|
||||
using UnityEngine.SceneManagement;
|
||||
using UnityEditor.SceneManagement;
|
||||
using static VTabs.VTabsAddTabWindow;
|
||||
using static VTabs.Libs.VUtils;
|
||||
using static VTabs.Libs.VGUI;
|
||||
// using static VTools.VDebug;
|
||||
|
||||
namespace VTabs
|
||||
{
|
||||
[FilePath("Library/vTabs Cache.asset", FilePathAttribute.Location.ProjectFolder)]
|
||||
public class VTabsCache : ScriptableSingleton<VTabsCache>
|
||||
{
|
||||
|
||||
public List<TabEntry> allTabEntries = new();
|
||||
|
||||
|
||||
[System.Serializable]
|
||||
public class TabEntry
|
||||
{
|
||||
public string name = "";
|
||||
public string iconName = "";
|
||||
public string typeString = "";
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static void Save() => instance.Save(saveAsText: true);
|
||||
|
||||
public static void Clear() => instance.allTabEntries.Clear();
|
||||
|
||||
}
|
||||
}
|
||||
#endif
|
||||
11
Assets/vTabs/VTabsCache.cs.meta
Normal file
11
Assets/vTabs/VTabsCache.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e727e3495b7464d28aa9d2d5cf3a06bf
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
1005
Assets/vTabs/VTabsGUI.cs
Normal file
1005
Assets/vTabs/VTabsGUI.cs
Normal file
File diff suppressed because it is too large
Load Diff
11
Assets/vTabs/VTabsGUI.cs.meta
Normal file
11
Assets/vTabs/VTabsGUI.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 291c4a11da18041c49b4772d9e054145
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
1907
Assets/vTabs/VTabsLibs.cs
Normal file
1907
Assets/vTabs/VTabsLibs.cs
Normal file
File diff suppressed because it is too large
Load Diff
11
Assets/vTabs/VTabsLibs.cs.meta
Normal file
11
Assets/vTabs/VTabsLibs.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 91d4456e469254096af9035b29263ca5
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
197
Assets/vTabs/VTabsMenu.cs
Normal file
197
Assets/vTabs/VTabsMenu.cs
Normal file
@@ -0,0 +1,197 @@
|
||||
#if UNITY_EDITOR
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using UnityEditor.ShortcutManagement;
|
||||
using System.Reflection;
|
||||
using System.Linq;
|
||||
using UnityEngine.UIElements;
|
||||
using static VTabs.Libs.VUtils;
|
||||
// using static VTools.VDebug;
|
||||
|
||||
|
||||
namespace VTabs
|
||||
{
|
||||
public static class VTabsMenu
|
||||
{
|
||||
|
||||
public static bool dragndropEnabled { get => EditorPrefsCached.GetBool("vTabs-dragndropEnabled", true); set => EditorPrefsCached.SetBool("vTabs-dragndropEnabled", value); }
|
||||
public static bool addTabButtonEnabled { get => EditorPrefsCached.GetBool("vTabs-addTabButtonEnabled", false); set => EditorPrefsCached.SetBool("vTabs-addTabButtonEnabled", value); }
|
||||
public static bool closeTabButtonEnabled { get => EditorPrefsCached.GetBool("vTabs-closeTabButtonEnabled", false); set => EditorPrefsCached.SetBool("vTabs-closeTabButtonEnabled", value); }
|
||||
public static bool dividersEnabled { get => EditorPrefsCached.GetBool("vTabs-dividersEnabled", false); set => EditorPrefsCached.SetBool("vTabs-dividersEnabled", value); }
|
||||
public static bool hideLockButtonEnabled { get => EditorPrefsCached.GetBool("vTabs-hideLockButtonEnabled", false); set => EditorPrefsCached.SetBool("vTabs-hideLockButtonEnabled", value); }
|
||||
|
||||
public static int tabStyle { get => EditorPrefsCached.GetInt("vTabs-tabStyle", 0); set => EditorPrefsCached.SetInt("vTabs-tabStyle", value); }
|
||||
public static bool defaultTabStyleEnabled => tabStyle == 0 || !Application.unityVersion.StartsWith("6000");
|
||||
public static bool largeTabStyleEnabled => tabStyle == 1 && Application.unityVersion.StartsWith("6000");
|
||||
public static bool neatTabStyleEnabled => tabStyle == 2 && Application.unityVersion.StartsWith("6000");
|
||||
|
||||
public static int backgroundStyle { get => EditorPrefsCached.GetInt("vTabs-backgroundStyle", 0); set => EditorPrefsCached.SetInt("vTabs-backgroundStyle", value); }
|
||||
public static bool defaultBackgroundEnabled => backgroundStyle == 0 || !Application.unityVersion.StartsWith("6000");
|
||||
public static bool classicBackgroundEnabled => backgroundStyle == 1 && Application.unityVersion.StartsWith("6000");
|
||||
public static bool greyBackgroundEnabled => backgroundStyle == 2 && Application.unityVersion.StartsWith("6000");
|
||||
|
||||
|
||||
public static bool switchTabShortcutEnabled { get => EditorPrefsCached.GetBool("vTabs-switchTabShortcutEnabled", true); set => EditorPrefsCached.SetBool("vTabs-switchTabShortcutEnabled", value); }
|
||||
public static bool addTabShortcutEnabled { get => EditorPrefsCached.GetBool("vTabs-addTabShortcutEnabled", true); set => EditorPrefsCached.SetBool("vTabs-addTabShortcutEnabled", value); }
|
||||
public static bool closeTabShortcutEnabled { get => EditorPrefsCached.GetBool("vTabs-closeTabShortcutEnabled", true); set => EditorPrefsCached.SetBool("vTabs-closeTabShortcutEnabled", value); }
|
||||
public static bool reopenTabShortcutEnabled { get => EditorPrefsCached.GetBool("vTabs-reopenTabShortcutEnabled", true); set => EditorPrefsCached.SetBool("vTabs-reopenTabShortcutEnabled", value); }
|
||||
|
||||
public static bool sidescrollEnabled { get => EditorPrefsCached.GetBool("vTabs-sidescrollEnabled", Application.platform == RuntimePlatform.OSXEditor); set => EditorPrefsCached.SetBool("vTabs-sidescrollEnabled", value); }
|
||||
public static float sidescrollSensitivity { get => EditorPrefsCached.GetFloat("vTabs-sidescrollSensitivity", 1); set => EditorPrefsCached.SetFloat("vTabs-sidescrollSensitivity", value); }
|
||||
public static bool reverseScrollDirectionEnabled { get => EditorPrefs.GetBool("vTabs-reverseScrollDirectionDirection", false); set => EditorPrefs.SetBool("vTabs-reverseScrollDirectionDirection", value); }
|
||||
|
||||
public static bool pluginDisabled { get => EditorPrefsCached.GetBool("vTabs-pluginDisabled", false); set => EditorPrefsCached.SetBool("vTabs-pluginDisabled", value); }
|
||||
|
||||
|
||||
|
||||
|
||||
const string dir = "Tools/vTabs/";
|
||||
#if UNITY_EDITOR_OSX
|
||||
const string cmd = "Cmd";
|
||||
#else
|
||||
const string cmd = "Ctrl";
|
||||
#endif
|
||||
|
||||
const string dragndrop = dir + "Create tabs with Drag-and-Drop";
|
||||
const string reverseScrollDirection = dir + "Reverse direction";
|
||||
const string addTabButton = dir + "Add Tab button";
|
||||
const string closeTabButton = dir + "Close Tab button";
|
||||
const string dividers = dir + "Tab dividers";
|
||||
const string hideLockButton = dir + "Hide lock button";
|
||||
|
||||
const string defaultTabStyle = dir + "Tab style/Default";
|
||||
const string largeTabs = dir + "Tab style/Large";
|
||||
const string neatTabs = dir + "Tab style/Neat";
|
||||
|
||||
const string defaultBackgroundStyle = dir + "Background style/Default";
|
||||
const string classicBackground = dir + "Background style/Classic";
|
||||
const string greyBackground = dir + "Background style/Grey";
|
||||
|
||||
|
||||
const string switchTabShortcut = dir + "Shift-Scroll to switch tab";
|
||||
const string addTabShortcut = dir + cmd + "-T to add tab";
|
||||
const string closeTabShortcut = dir + cmd + "-W to close tab";
|
||||
const string reopenTabShortcut = dir + cmd + "-Shift-T to reopen closed tab";
|
||||
|
||||
|
||||
const string sidescroll = dir + "Sidescroll to switch tab";
|
||||
const string increaseSensitivity = dir + "Increase sensitivity";
|
||||
const string decreaseSensitivity = dir + "Decrease sensitivity";
|
||||
|
||||
|
||||
const string disablePlugin = dir + "Disable vTabs";
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
[MenuItem(dir + "Features", false, 1)] static void dadsas() { }
|
||||
[MenuItem(dir + "Features", true, 1)] static bool dadsas123() => false;
|
||||
|
||||
// [MenuItem(dragndrop, false, 2)] static void dadsadsadasdsadadsas() => dragndropEnabled = !dragndropEnabled;
|
||||
// [MenuItem(dragndrop, true, 2)] static bool dadsaddsasadadsdasadsas() { Menu.SetChecked(dragndrop, dragndropEnabled); return !pluginDisabled; }
|
||||
|
||||
[MenuItem(addTabButton, false, 3)] static void dadsadsadsadasdsadadsas() { addTabButtonEnabled = !addTabButtonEnabled; VTabs.RepaintAllDockAreas(); }
|
||||
[MenuItem(addTabButton, true, 3)] static bool dadsadasddsasadadsdasadsas() { Menu.SetChecked(addTabButton, addTabButtonEnabled); return !pluginDisabled; }
|
||||
|
||||
[MenuItem(closeTabButton, false, 4)] static void dadsadsaddassadasdsadadsas() { closeTabButtonEnabled = !closeTabButtonEnabled; VTabs.RepaintAllDockAreas(); }
|
||||
[MenuItem(closeTabButton, true, 4)] static bool dadsadasddsadsasadadsdasadsas() { Menu.SetChecked(closeTabButton, closeTabButtonEnabled); return !pluginDisabled; }
|
||||
|
||||
[MenuItem(dividers, false, 5)] static void dadsadsaddasdssadasdsadadsas() { dividersEnabled = !dividersEnabled; VTabs.RepaintAllDockAreas(); }
|
||||
[MenuItem(dividers, true, 5)] static bool dadsadasddsdsadsasadadsdasadsas() { Menu.SetChecked(dividers, dividersEnabled); return !pluginDisabled; }
|
||||
|
||||
[MenuItem(hideLockButton, false, 7)] static void dadsadsaddsdassadasdsadadsas() { hideLockButtonEnabled = !hideLockButtonEnabled; VTabs.RepaintAllDockAreas(); }
|
||||
[MenuItem(hideLockButton, true, 7)] static bool dadsadasdsdsadsasadadsdasadsas() { Menu.SetChecked(hideLockButton, hideLockButtonEnabled); return !pluginDisabled; }
|
||||
|
||||
#if UNITY_6000_0_OR_NEWER
|
||||
|
||||
[MenuItem(defaultTabStyle, false, 8)] static void dadsadsaddasdssadasdssdadadsas() { tabStyle = 0; VTabs.UpdateStyleSheet(); }
|
||||
[MenuItem(defaultTabStyle, true, 8)] static bool dadsadasddsdsdsadsasadadsdasadsas() { Menu.SetChecked(defaultTabStyle, tabStyle == 0); return !pluginDisabled; }
|
||||
|
||||
[MenuItem(largeTabs, false, 9)] static void dadsadsaddasdssadsdasdssdadadsas() { tabStyle = 1; VTabs.UpdateStyleSheet(); }
|
||||
[MenuItem(largeTabs, true, 9)] static bool dadsadasddsdsdsdsadsasadadsdasadsas() { Menu.SetChecked(largeTabs, tabStyle == 1); return !pluginDisabled; }
|
||||
|
||||
[MenuItem(neatTabs, false, 10)] static void dadsadsaddasdsssadasdssdadadsas() { tabStyle = 2; VTabs.UpdateStyleSheet(); }
|
||||
[MenuItem(neatTabs, true, 10)] static bool dadsadasddsdsddssadsasadadsdasadsas() { Menu.SetChecked(neatTabs, tabStyle == 2); return !pluginDisabled; }
|
||||
|
||||
|
||||
|
||||
[MenuItem(defaultBackgroundStyle, false, 11)] static void dadsadsaddasdsdssadasdssdadadsas() { backgroundStyle = 0; VTabs.UpdateStyleSheet(); }
|
||||
[MenuItem(defaultBackgroundStyle, true, 11)] static bool dadsadasddssddsdsadsasadadsdasadsas() { Menu.SetChecked(defaultBackgroundStyle, backgroundStyle == 0); return !pluginDisabled; }
|
||||
|
||||
[MenuItem(classicBackground, false, 12)] static void dadsadsadsddasdssadsdasdssdadadsas() { backgroundStyle = 1; VTabs.UpdateStyleSheet(); }
|
||||
[MenuItem(classicBackground, true, 12)] static bool dadsadasddsdsdsdsdsadsasadadsdasadsas() { Menu.SetChecked(classicBackground, backgroundStyle == 1); return !pluginDisabled; }
|
||||
|
||||
// [MenuItem(greyBackground, false, 12)] static void dadsadsdsadsddasdssadsdasdssdadadsas() { backgroundStyle = 2; VTabs.UpdateStyleSheet(); }
|
||||
// [MenuItem(greyBackground, true, 12)] static bool dadsadasdsddsdsdsdsdsadsasadadsdasadsas() { Menu.SetChecked(greyBackground, backgroundStyle == 2); return !pluginDisabled; }
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
[MenuItem(dir + "Shortcuts", false, 101)] static void daaadsas() { }
|
||||
[MenuItem(dir + "Shortcuts", true, 101)] static bool daadsdsas123() => false;
|
||||
|
||||
[MenuItem(switchTabShortcut, false, 102)] static void dadsadsadsadsadasdsadadsas() => switchTabShortcutEnabled = !switchTabShortcutEnabled;
|
||||
[MenuItem(switchTabShortcut, true, 102)] static bool dadsadasdasddsasadadsdasadsas() { Menu.SetChecked(switchTabShortcut, switchTabShortcutEnabled); return !pluginDisabled; }
|
||||
|
||||
[MenuItem(addTabShortcut, false, 103)] static void dadsadadsas() => addTabShortcutEnabled = !addTabShortcutEnabled;
|
||||
[MenuItem(addTabShortcut, true, 103)] static bool dadsaddasadsas() { Menu.SetChecked(addTabShortcut, addTabShortcutEnabled); return !pluginDisabled; }
|
||||
|
||||
[MenuItem(closeTabShortcut, false, 104)] static void dadsadasdadsas() => closeTabShortcutEnabled = !closeTabShortcutEnabled;
|
||||
[MenuItem(closeTabShortcut, true, 104)] static bool dadsadsaddasadsas() { Menu.SetChecked(closeTabShortcut, closeTabShortcutEnabled); return !pluginDisabled; }
|
||||
|
||||
[MenuItem(reopenTabShortcut, false, 105)] static void dadsadsadasdadsas() => reopenTabShortcutEnabled = !reopenTabShortcutEnabled;
|
||||
[MenuItem(reopenTabShortcut, true, 105)] static bool dadsaddsasaddasadsas() { Menu.SetChecked(reopenTabShortcut, reopenTabShortcutEnabled); return !pluginDisabled; }
|
||||
|
||||
|
||||
|
||||
|
||||
#if UNITY_EDITOR_OSX
|
||||
|
||||
[MenuItem(dir + "Trackpad", false, 1001)] static void daadsdsadsas() { }
|
||||
[MenuItem(dir + "Trackpad", true, 1001)] static bool dadsasasdads() => false;
|
||||
|
||||
[MenuItem(sidescroll, false, 1002)] static void dadsadsadsadsadasdadssadadsas() => sidescrollEnabled = !sidescrollEnabled;
|
||||
[MenuItem(sidescroll, true, 1002)] static bool dadsadasdasddsadassadadsdasadsas() { Menu.SetChecked(sidescroll, sidescrollEnabled); return !pluginDisabled; }
|
||||
|
||||
[MenuItem(increaseSensitivity, false, 1004)] static void qdadadsssa() { sidescrollSensitivity += .2f; Debug.Log("vTabs: scrolling sensitivity increased to " + sidescrollSensitivity * 100 + "%"); }
|
||||
[MenuItem(increaseSensitivity, true, 1004)] static bool qdaddasadsssa() => !pluginDisabled;
|
||||
|
||||
[MenuItem(decreaseSensitivity, false, 1005)] static void qdasadsssa() { sidescrollSensitivity -= .2f; Debug.Log("vTabs: trackpad sensitivity decreased to " + sidescrollSensitivity * 100 + "%"); }
|
||||
[MenuItem(decreaseSensitivity, true, 1005)] static bool qdaddasdsaadsssa() => !pluginDisabled;
|
||||
|
||||
// [MenuItem(reverseScrollDirection, false, 1006)] static void dadsadadssadsadsadasdadssadadsas() => reverseScrollDirectionEnabled = !reverseScrollDirectionEnabled;
|
||||
// [MenuItem(reverseScrollDirection, true, 1006)] static bool dadsadasdadsasddsadassadadsdasadsas() { Menu.SetChecked(reverseScrollDirection, reverseScrollDirectionEnabled); return !pluginDisabled; } // don't delete the option, there are people using it
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
[MenuItem(dir + "More", false, 10001)] static void daasadsddsas() { }
|
||||
[MenuItem(dir + "More", true, 10001)] static bool dadsadsdasas123() => false;
|
||||
|
||||
[MenuItem(dir + "Open manual", false, 10002)]
|
||||
static void dadadssadsas() => Application.OpenURL("https://kubacho-lab.gitbook.io/vtabs-2");
|
||||
|
||||
[MenuItem(dir + "Join our Discord", false, 10003)]
|
||||
static void dadasdsas() => Application.OpenURL("https://discord.gg/pUektnZeJT");
|
||||
|
||||
|
||||
|
||||
|
||||
[MenuItem(disablePlugin, false, 100001)] static void dadsadsdasadasdasdsadadsas() { pluginDisabled = !pluginDisabled; VTabs.UpdateStyleSheet(); UnityEditor.Compilation.CompilationPipeline.RequestScriptCompilation(); }
|
||||
[MenuItem(disablePlugin, true, 100001)] static bool dadsaddssdaasadsadadsdasadsas() { Menu.SetChecked(disablePlugin, pluginDisabled); return true; }
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
#endif
|
||||
11
Assets/vTabs/VTabsMenu.cs.meta
Normal file
11
Assets/vTabs/VTabsMenu.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3cf48ada98a1147c4881faf7b79475e6
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
6
Assets/vTabs/VTabsMenuItems.cs
Normal file
6
Assets/vTabs/VTabsMenuItems.cs
Normal file
@@ -0,0 +1,6 @@
|
||||
|
||||
|
||||
// this file was present in a previus version and is supposed to be deleted now
|
||||
// but asset store update delivery system doesn't allow deleting files
|
||||
// so instead this file is now emptied
|
||||
// feel free to delete it if you want
|
||||
11
Assets/vTabs/VTabsMenuItems.cs.meta
Normal file
11
Assets/vTabs/VTabsMenuItems.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 102836a637c684c11b7581d444fecb04
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
242
Assets/vTabs/VTabsPlaceholderWindow.cs
Normal file
242
Assets/vTabs/VTabsPlaceholderWindow.cs
Normal file
@@ -0,0 +1,242 @@
|
||||
#if UNITY_EDITOR
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using UnityEditor.ShortcutManagement;
|
||||
using System.Reflection;
|
||||
using System.Linq;
|
||||
using UnityEngine.UIElements;
|
||||
using UnityEngine.SceneManagement;
|
||||
using UnityEditor.SceneManagement;
|
||||
using System.Diagnostics;
|
||||
using Type = System.Type;
|
||||
using Delegate = System.Delegate;
|
||||
using Action = System.Action;
|
||||
using static VTabs.Libs.VUtils;
|
||||
using static VTabs.Libs.VGUI;
|
||||
// using static VTools.VDebug;
|
||||
|
||||
|
||||
|
||||
namespace VTabs
|
||||
{
|
||||
public class VTabsPlaceholderWindow : EditorWindow
|
||||
{
|
||||
|
||||
|
||||
void OnGUI()
|
||||
{
|
||||
|
||||
// GUILayout.Label(objectGlobalID.ToString());
|
||||
// GUILayout.Label(objectGlobalID.guid.ToPath());
|
||||
|
||||
|
||||
// if (isSceneObject)
|
||||
// GUILayout.Label("scene object");
|
||||
|
||||
// if (isPrefabObject)
|
||||
// GUILayout.Label("prefab object");
|
||||
|
||||
|
||||
|
||||
var fontSize = 13;
|
||||
|
||||
|
||||
var assetName = objectGlobalID.guid.ToPath().GetFilename();
|
||||
|
||||
var assetIcon = AssetDatabase.GetCachedIcon(objectGlobalID.guid.ToPath());
|
||||
|
||||
|
||||
void label()
|
||||
{
|
||||
|
||||
GUI.skin.label.fontSize = fontSize;
|
||||
|
||||
|
||||
|
||||
GUILayout.Label("This object is from " + assetName + ", which isn't loaded");
|
||||
|
||||
|
||||
var iconRect = lastRect.MoveX("This object is from".GetLabelWidth()).SetWidth(20).SetSizeFromMid(16).MoveX(.5f);
|
||||
|
||||
GUI.DrawTexture(iconRect, assetIcon);
|
||||
|
||||
|
||||
|
||||
GUI.skin.label.fontSize = 0;
|
||||
|
||||
}
|
||||
void button()
|
||||
{
|
||||
GUI.skin.button.fontSize = fontSize;
|
||||
|
||||
|
||||
var buttonText = "Load " + assetName;
|
||||
|
||||
if (GUILayout.Button(buttonText, GUILayout.Height(30), GUILayout.Width(buttonText.GetLabelWidth(fontSize: fontSize) + 34)))
|
||||
if (isPrefabObject)
|
||||
PrefabStageUtility.OpenPrefab(objectGlobalID.guid.ToPath());
|
||||
else if (isSceneObject)
|
||||
EditorSceneManager.OpenScene(objectGlobalID.guid.ToPath());
|
||||
{ } // todonow
|
||||
|
||||
|
||||
|
||||
var iconRect = lastRect.MoveX("Load".GetLabelWidth()).SetWidth(20).SetSizeFromMid(16).MoveX(23 - 3);
|
||||
|
||||
GUI.DrawTexture(iconRect, assetIcon);
|
||||
|
||||
|
||||
|
||||
|
||||
GUI.skin.button.fontSize = 0;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
GUILayout.Space(15);
|
||||
// BeginIndent(10);
|
||||
GUILayout.BeginHorizontal();
|
||||
GUILayout.Space(10);
|
||||
GUILayout.BeginVertical();
|
||||
|
||||
|
||||
label();
|
||||
|
||||
Space(10);
|
||||
button();
|
||||
|
||||
GUILayout.EndVertical();
|
||||
GUILayout.EndHorizontal();
|
||||
|
||||
|
||||
|
||||
void tryLoadPrefabObject()
|
||||
{
|
||||
if (!isPrefabObject) return;
|
||||
if (StageUtility.GetCurrentStage() is not PrefabStage prefabStage) return;
|
||||
if (prefabStage.assetPath != objectGlobalID.guid.ToPath()) return;
|
||||
|
||||
if (objectGlobalID.GetObject() is not Object prefabAssetObject) return;
|
||||
|
||||
|
||||
|
||||
if (prefabAssetObject is Component assetComponent)
|
||||
if (prefabStage.prefabContentsRoot.GetComponentsInChildren(assetComponent.GetType())
|
||||
.FirstOrDefault(r => GlobalID.GetForPrefabStageObject(r) == objectGlobalID) is Component instanceComoponent)
|
||||
Close_andOpenPropertyEditor(instanceComoponent);
|
||||
|
||||
|
||||
|
||||
if (prefabAssetObject is GameObject assetGo)
|
||||
if (prefabStage.prefabContentsRoot.GetComponentsInChildren<Transform>()
|
||||
.Select(r => r.gameObject)
|
||||
.FirstOrDefault(r => GlobalID.GetForPrefabStageObject(r) == objectGlobalID) is GameObject isntanceGo)
|
||||
Close_andOpenPropertyEditor(isntanceGo);
|
||||
|
||||
}
|
||||
void tryLoadSceneObject()
|
||||
{
|
||||
if (!isSceneObject) return;
|
||||
|
||||
var loadedScenes = Enumerable.Range(0, EditorSceneManager.sceneCount)
|
||||
.Select(i => EditorSceneManager.GetSceneAt(i))
|
||||
.Where(r => r.isLoaded);
|
||||
if (!loadedScenes.Any(r => r.path == objectGlobalID.guid.ToPath())) return;
|
||||
|
||||
if (objectGlobalID.GetObject() is not Object loadedObject) return;
|
||||
|
||||
|
||||
Close_andOpenPropertyEditor(loadedObject);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
tryLoadPrefabObject();
|
||||
tryLoadSceneObject();
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public void Close_andOpenPropertyEditor(Object o)
|
||||
{
|
||||
var dockArea = this.GetMemberValue<Object>("m_Parent");
|
||||
var tabIndex = dockArea.GetMemberValue<List<EditorWindow>>("m_Panes").IndexOf(this);
|
||||
|
||||
|
||||
var tabInfo = new VTabs.TabInfo(o);
|
||||
|
||||
tabInfo.originalTabIndex = tabIndex;
|
||||
|
||||
|
||||
VTabs.guis_byDockArea[dockArea].AddTab(tabInfo, atOriginalTabIndex: true);
|
||||
|
||||
|
||||
|
||||
this.Close();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public void Open_andReplacePropertyEditor(EditorWindow propertyEditorToReplace)
|
||||
{
|
||||
|
||||
objectGlobalID = new GlobalID(propertyEditorToReplace.GetMemberValue<string>("m_GlobalObjectId"));
|
||||
|
||||
|
||||
isSceneObject = AssetDatabase.GetMainAssetTypeAtPath(objectGlobalID.guid.ToPath()) == typeof(SceneAsset);
|
||||
isPrefabObject = AssetDatabase.GetMainAssetTypeAtPath(objectGlobalID.guid.ToPath()) == typeof(GameObject);
|
||||
|
||||
if (!isSceneObject && !isPrefabObject) { propertyEditorToReplace.Close(); Object.DestroyImmediate(this); return; }
|
||||
|
||||
|
||||
|
||||
|
||||
var dockArea = propertyEditorToReplace.GetMemberValue("m_Parent");
|
||||
|
||||
var tabIndex = dockArea.GetMemberValue<List<EditorWindow>>("m_Panes")
|
||||
.IndexOf(propertyEditorToReplace);
|
||||
|
||||
dockArea.InvokeMethod("AddTab", tabIndex, this, true);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
this.titleContent = propertyEditorToReplace.titleContent;
|
||||
|
||||
|
||||
if (propertyEditorToReplace.hasFocus)
|
||||
this.Focus();
|
||||
|
||||
|
||||
propertyEditorToReplace.Close();
|
||||
|
||||
|
||||
}
|
||||
|
||||
public GlobalID objectGlobalID;
|
||||
|
||||
public bool isSceneObject;
|
||||
public bool isPrefabObject;
|
||||
|
||||
// todonow scene config? active/additive, if active, which otehr additive scenes were loaded?
|
||||
|
||||
}
|
||||
}
|
||||
#endif
|
||||
11
Assets/vTabs/VTabsPlaceholderWindow.cs.meta
Normal file
11
Assets/vTabs/VTabsPlaceholderWindow.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 176a13b0483f24d39af2f0b00467885b
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user