//============================================================================== // 関数 //============================================================================== public static void Open(CustomizableToolbarSettings settings) { //var win = GetWindow<CustomizableToolbar>( TITLE ); var win = CreateInstance <CustomizableToolbar>(); win.titleContent = new GUIContent(TITLE); win.m_settings = settings; win.Show(); var pos = win.position; pos.height = WINDOW_HEIGHT; win.position = pos; var minSize = win.minSize; minSize.y = WINDOW_HEIGHT; win.minSize = minSize; var maxSize = win.maxSize; maxSize.y = WINDOW_HEIGHT; win.maxSize = maxSize; }
private void OnEnable() { var mono = MonoScript.FromScriptableObject(this); var scriptPath = AssetDatabase.GetAssetPath(mono); var dir = Path.GetDirectoryName(scriptPath); var path = string.Format("{0}/Settings.asset", dir); m_settings = AssetDatabase.LoadAssetAtPath <CustomizableToolbarSettings>(path); }