Skip to content

hananoki/SharedModule

Repository files navigation

Shared Module

Japanese (by Google Translate)

Overview

  • Module required for package created by "Hananoki"

Installation

  • Add following lines to the dependencies section of the Packages/manifest.json.
"dependencies": {
  "com.hananoki.shared-module": "https://github.com/hananoki/SharedModule.git",
  ...
}

Description

  • It summarizes useful processing for editor extension

EditorExtension

  • I want to omit the argument, I want to make it as short as possible, it is a mass of laziness
var path = "Assets/sample.asset";
var obj1 = path.LoadAsset(); // Can be read
var guid = "bfb0d91c07d48f140962d6de9b6fef33";
var obj2 = path.LoadAsset(); // Can be read
var m = new GenericMenu();
m.AddItem("Menu", ()=>{ Debug.Log("GUIContent is a hassle") } );
m.DropDownAtMousePosition(); // I also call Event.current.Use()

EditorIcon

  • Over 1000 Unity Icon Resources Available
  • Automatically switches according to the skin
GUILayout.Label( EditorIcon.customtool );

UnityTypes

  • Get internal type without using reflection
  • Considering version compatibility
EditorWindow.GetWindow( UnityTypes.UnityEditor_ProjectBrowser );

UnityReflection

  • Access private features
  • Delegate.CreateDelegate whenever possible
AudioClip clip;
UnityEditorAudioUtil.PlayClip( clip );

// Why is it internal?
BuildTargetGroup group = UnityEditorEditorUserBuildSettings.activeBuildTargetGroup;

// Splitter used in AnimatobWindow etc.
var splitter = new UnityEditorSplitterState( 0.20f, 0.80f );
UnityEditorSplitterGUILayout.BeginHorizontalSplit( splitter );
GUILayout.BeginVertical()
... GUI Function
GUILayout.EndVertical()
GUILayout.BeginVertical()
... GUI Function
GUILayout.EndVertical()
UnityEditorSplitterGUILayout.EndHorizontalSplit();
  • I introduced some functions by excerpting

Other Tools

  • Introduction of packages that use this module
  • An auxiliary tool for differential build, batch build, etc.
  • A simple customized hierarchy
  • A simple customized project browser
  • You can edit fontsettings.txt
  • Rewrite font settings in UnityEditor.EditorStyles
  • Frequently used functions are summarized in the toolbar
  • Add a drop down menu next to the hierarchy game object name

  • Add tools to SceneView

  • Tool to manage ScriptingDefineSymbols

### UnityReflection - Provides access to UnityEditor's inner classes with reflection

Licence

MIT

About

Module required for package created by "Hananoki"

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages