Esempio n. 1
0
        private void OnPrefabGUI()
        {
            DrawPreview();
            GameObject prefab = target as GameObject;

            EditableNameField(prefab);


            if (MapAssetManager.ContainsPrefab(prefab))
            {
                //在表列
                MapAssetManager.CurrentInformation = EditorGUILayout.TextArea(MapAssetManager.CurrentInformation, Prefs.informationStyle);

                if (GUILayout.Button("", Prefs.mapAssetBackgroundStyle, GUILayout.ExpandHeight(true)))
                {
                    GUI.FocusControl("");
                }
                GUILayout.BeginHorizontal(Prefs.mapAssetBackgroundStyle, GUILayout.Height(28));
                {
                    GUILayout.FlexibleSpace();
                }
                GUILayout.EndHorizontal();
            }
            else
            {
                //不在表列

                if (GUILayout.Button("", Prefs.mapAssetBackgroundStyle, GUILayout.ExpandHeight(true)))
                {
                    GUI.FocusControl("");
                }
                GUILayout.BeginHorizontal(Prefs.mapAssetBackgroundStyle, GUILayout.Height(28));
                {
                    GUILayout.FlexibleSpace();
                    if (GUILayout.Button("加入物品表列", GUILayout.Width(120)))
                    {
                        MapAssetManager.AddPrefab(prefab); FocusOn(MapAssetManager.CurrentPrefab, SelectionType.Prefab);
                    }
                }
                GUILayout.EndHorizontal();
            }
        }
Esempio n. 2
0
 private void OnEnable()
 {
     instance = this;
 }