public override void Initialize()
        {
            if (Instance != null)
            {
                Log("Warning: EnemyRandomizer is a singleton. Trying to create more than one may cause issues!");
                return;
            }

            Instance = this;
            comms    = new CommunicationNode();
            comms.EnableNode(this);

            Log("Enemy Randomizer Mod initializing!");

            SetupDefaulSettings();

            UnRegisterCallbacks();
            RegisterCallbacks();

            //create the database that will hold all the loaded enemies
            if (database == null)
            {
                database = new EnemyRandomizerDatabase();
            }

            if (logic == null)
            {
                logic = new EnemyRandomizerLogic(database);
            }

            //create the loader which will handle loading all the enemy types in the game
            if (loader == null)
            {
                loader = new EnemyRandomizerLoader(database);
            }

            //Create all mod UI elements and their manager
            if (menu == null)
            {
                menu = new Menu.RandomizerMenu();
            }

            database.Setup();
            loader.Setup();
            menu.Setup();

            ContractorManager.Instance.StartCoroutine(DebugInput());
        }
 public EnemyRandomizerLoader(EnemyRandomizerDatabase database)
 {
     this.database = database;
 }
Exemple #3
0
 public void Unload()
 {
     comms.DisableNode();
     Instance = null;
 }
Exemple #4
0
 public void Setup()
 {
     Instance = this;
     comms    = new CommunicationNode();
     comms.EnableNode(this);
 }