Пример #1
0
        static Main()
        {
            list = new List <EditorEnhancement>();

            // find all classes which derive from EditorEnhancement
            // and create an instance of each one

            Type     tEnhancement = typeof(EditorEnhancement);
            Assembly a            = Assembly.GetAssembly(tEnhancement);

            foreach (Type type in a.GetTypes())
            {
                if (type.IsClass && !type.IsAbstract && type.IsSubclassOf(tEnhancement))
                {
                    EditorEnhancement e = (EditorEnhancement)Activator.CreateInstance(type);
                    list.Add(e);
                }
            }


            // enable all those which are actually enabled

            foreach (EditorEnhancement e in list)
            {
                if (EditorPrefs.GetBool(e.Prefix + "_Enabled", true))
                {
                    e.OnEnable();
                }
            }
        }
Пример #2
0
 public int this[EditorEnhancement pFor, string pName, int pDefault = 0]
 {
     get { return(EditorPrefs.GetInt("EE_" + pFor.Prefix + "_" + pName, pDefault)); }
     set { EditorPrefs.SetInt("EE_" + pFor.Prefix + "_" + pName, value); }
 }
Пример #3
0
 public bool this[EditorEnhancement pFor, string pName, bool pDefault = false]
 {
     get { return(EditorPrefs.GetBool("EE_" + pFor.Prefix + "_" + pName, pDefault)); }
     set { EditorPrefs.SetBool("EE_" + pFor.Prefix + "_" + pName, value); }
 }