protected override void Load()
        {
            Instance     = this;
            MessageColor = UnturnedChat.GetColorFromName(Configuration.Instance.MessageColor, UnityEngine.Color.green);

            animalManagerField = typeof(AnimalManager).GetField("manager", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.IgnoreCase | BindingFlags.Static);

            HarmonyInstance = new Harmony(HarmonyInstanceId);
            HarmonyInstance.PatchAll(Assembly);

            if (Configuration.Instance.UseMySQL)
            {
                Database = new MySQLPetsDatabaseProvider();
            }
            else
            {
                Database = new JsonPetsDatabaseProvider();
            }

            Database.Reload();

            PetsService         = gameObject.AddComponent <PetsService>();
            PetsMovementService = gameObject.AddComponent <PetsMovementService>();

            Logger.Log($"{Name} {Assembly.GetName().Version} has been loaded!", ConsoleColor.Yellow);
        }
Ejemplo n.º 2
0
        protected override void Load()
        {
            Instance     = this;
            MessageColor = UnturnedChat.GetColorFromName(Configuration.Instance.MessageColor, UnityEngine.Color.green);

            HarmonyInstance = new Harmony(HarmonyInstanceId);
            HarmonyInstance.PatchAll(Assembly);

            if (Configuration.Instance.UseMySQL)
            {
                Database = new MySQLPetsDatabaseProvider();
            }
            else
            {
                Database = new JsonPetsDatabaseProvider();
            }

            Database.Reload();

            PetsService         = gameObject.AddComponent <PetsService>();
            PetsMovementService = gameObject.AddComponent <PetsMovementService>();

            Logger.Log($"Made by AdamAdam, maintained by Restore Monarchy Plugins", ConsoleColor.Yellow);
            Logger.Log($"{Name} {Assembly.GetName().Version} has been loaded!", ConsoleColor.Yellow);
        }