Esempio n. 1
0
        private void InitFilterClasses()
        {
            List <Type> loadedTypes = GCommon.GetAllLoadedTypes();

            FilterTypes = loadedTypes.FindAll(
                t => t.IsSubclassOf(typeof(GSpawnFilter)));
        }
        public static void InitFilters()
        {
            List <Type> loadedTypes = GCommon.GetAllLoadedTypes();

            GSpawnFilter.AllFilters = loadedTypes.FindAll(
                t => t.IsSubclassOf(typeof(GSpawnFilter)));
        }
        private void InitModifierClasses()
        {
            List <Type> loadedTypes = GCommon.GetAllLoadedTypes();

            ModifierTypes = loadedTypes.FindAll(
                t => t.IsSubclassOf(typeof(GSplineModifier)));
        }
        public static void RefreshCustomPainterTypes()
        {
            List <Type> loadedTypes = GCommon.GetAllLoadedTypes();

            CustomPainterTypes = loadedTypes.FindAll(
                t => t.GetInterface(ObjectPainterInterfaceName) != null &&
                !BUILTIN_PAINTER_NAME.Contains(t.Name));
        }
        private IGTextureGenerator GetActiveGenerator()
        {
            GTextureGenerationMode mode = GTextureToolParams.Instance.General.Mode;
            string className            = "G" + mode.ToString() + "Generator";
            Type   type = GCommon.GetAllLoadedTypes().Find(t => t.Name.Equals(className));

            if (type != null && type.GetInterface(typeof(IGTextureGenerator).Name) != null)
            {
                return(Activator.CreateInstance(type) as IGTextureGenerator);
            }

            return(null);
        }
Esempio n. 6
0
        public static void ReloadExtensions()
        {
            List <Type> loadedTypes = GCommon.GetAllLoadedTypes();

            extensions = new List <GExtensionInfo>();
            for (int i = 0; i < loadedTypes.Count; ++i)
            {
                Type t = loadedTypes[i];
                if (string.IsNullOrEmpty(t.Namespace))
                {
                    continue;
                }
                if (!t.Namespace.EndsWith(".GriffinExtension"))
                {
                    continue;
                }

                GExtensionInfo info = GExtensionInfo.CreateFromType(t);
                if (!t.Namespace.StartsWith("Pinwheel.") &&
                    info.Publisher.Equals("Pinwheel Studio"))
                {
                    string error = string.Format(
                        "Griffin Extension: Error on initiating '{0}/{1}'. " +
                        "Publisher name 'Pinwheel Studio' is reserved. Please choose another name.",
                        t.Name,
                        info.Name);
                    Debug.Log(error);
                }
                else
                {
                    extensions.Add(info);
                }
            }

            extensions.RemoveAll(e =>
                                 string.IsNullOrEmpty(e.Publisher) ||
                                 string.IsNullOrEmpty(e.Name) ||
                                 e.OpenSupportLinkMethod == null);

            extensions.Sort((e0, e1) => e0.Name.CompareTo(e1.Name));
        }