示例#1
0
文件: Mod.cs 项目: EmpioDavion/Lizard
        private static Sprite LoadProjectileSprite(MonoBehaviour projectile)
        {
            IModProjectile modProj = (IModProjectile)projectile;
            string         projID  = Lizard.GetID(projectile);

            return(LoadObjectSprite(projectile, projID, "Projectile", modProj.ProjectileImage));
        }
示例#2
0
文件: Mod.cs 项目: EmpioDavion/Lizard
        internal void LoadProjectiles()
        {
            if (projectileTypes.Count == 0)
            {
                Logger.Log("No projectiles to load\n\n");
                return;
            }

            Logger.Log($"Loading {projectileTypes.Count} projectile type(s)\n");

            foreach (Type projectileType in projectileTypes)
            {
                Logger.Log($"Loading projectile {projectileType.FullName}");

                GameObject dummy = new GameObject();
                dummy.SetActive(false);

                MonoBehaviour proj = (MonoBehaviour)dummy.AddComponent(projectileType);

                Sprite sprite = LoadProjectileSprite(proj);

                ModManager.AddModProjectile(Lizard.GetID(projectileType), sprite);

                UnityEngine.Object.Destroy(dummy);
            }

            Logger.Log("");
        }
示例#3
0
文件: Mod.cs 项目: EmpioDavion/Lizard
 internal void InitModSkillInfos()
 {
     foreach (Type skillType in skillTypes)
     {
         ModManager.ModSkillDescriptions.Add(Lizard.GetID(skillType), ModManager.CreateSkillInfo());
     }
 }
示例#4
0
文件: Mod.cs 项目: EmpioDavion/Lizard
        private List <Type> Load <IT>(Type objectType, bool includeAbstract)
        {
            List <Type> result = new List <Type>();

            Type interfaceType = typeof(IT);

            foreach (Type type in types)
            {
                if (includeAbstract || !type.IsAbstract)
                {
                    if (Lizard.IsInterface(interfaceType, type) && type.IsSubclassOf(objectType))
                    {
                        result.Add(type);
                    }
                }
            }

            return(result);
        }
示例#5
0
        internal static void Reset()
        {
            foreach (KeyValuePair <string, IModItem> kvp in ModItems)
            {
                LootManager.completeItemDict.Remove(kvp.Key);
            }

            Mods.Clear();
            ModItems.Clear();
            ModItemImages.Clear();
            ModSkills.Clear();
            ModSkillImages.Clear();
            ModProjectileImages.Clear();
            ModItemDescriptions.Clear();
            ModSkillDescriptions.Clear();

            Lizard.Reset();
            LizardTitleScreen.Reset();
        }
示例#6
0
        public static void AwakeEnd(TitleScreen titleScreen)
        {
            FieldInfo fi = Lizard.GetFieldInfo <TitleScreen>("menuTextOpts", false, false);

            Text[] texts = (Text[])fi.GetValue(titleScreen);

            InitNullMenuOption("Single Player", texts[0]);
            InitNullMenuOption("Two Players", texts[1]);
            InitNullMenuOption("Versus", texts[2]);
            InitNullMenuOption("Options", texts[3]);
            InitNullMenuOption("Credits", texts[4]);
            InitNullMenuOption("Exit", texts[5]);

            fi.SetValue(titleScreen, CreateTextsArray());

            titleScreen.multiplayerOptIndex = IndexOfMenuOption("Two Players");
            titleScreen.versusOptIndex      = IndexOfMenuOption("Versus");

            SortMenuOptions();
        }
示例#7
0
文件: Mod.cs 项目: EmpioDavion/Lizard
        internal void LoadItems()
        {
            if (itemTypes.Count == 0)
            {
                Logger.Log("No items to load\n");
                return;
            }

            Logger.Log($"Loading {itemTypes.Count} item type(s)\n");

            foreach (Type itemType in itemTypes)
            {
                Logger.Log($"Loading item {itemType.FullName}");

                Item item = (Item)Activator.CreateInstance(itemType);
                item.ID = Lizard.GetID(itemType);

                Sprite sprite = LoadItemSprite(item);

                ModManager.AddModItem(item, sprite);
            }

            Logger.Log("");
        }