private static void Init()
        {
            NamespaceData data = GetData();

            if (data != null)
            {
                _name = data.name;
            }
        }
Exemplo n.º 2
0
        private static bool IsOn()
        {
            NamespaceData data = GetData();

            if (data != null)
            {
                return(data.IsOn);
            }

            return(false);
        }
        private void OnGUI()
        {
            GUILayout.Label("命名空间名称");
            Rect rect = EditorGUILayout.GetControlRect(GUILayout.Width(200));

            _name = EditorGUI.TextField(rect, _name);

            if (GUILayout.Button("完成", GUILayout.MaxWidth(100)))
            {
                NamespaceData data = new NamespaceData();
                data.name = _name;

                Directory.CreateDirectory(_path);
                AssetDatabase.CreateAsset(data, _path + _dataName);
            }
        }
        public static NamespaceData GetData()
        {
            NamespaceData data = AssetDatabase.LoadAssetAtPath <NamespaceData>(_path + _dataName);

            return(data);
        }