Exemplo n.º 1
0
        public override void Load()
        {
            Logger.LogInstance = Log;
            var useDevMsg   = Config.Bind(new ConfigDefinition("Logging", "UseLog"), false, new ConfigDescription("Using Log Message for Debug?"));
            var useLiveEdit = Config.Bind(new ConfigDefinition("Developer", "UseLiveEdit"), false, new ConfigDescription("Using Live Edit?"));

            Logger.UsingLog = useDevMsg.Value;
            PartialDataManager.CanLiveEdit = useLiveEdit.Value;

            if (!DataBlockTypeManager.Initialize())
            {
                Logger.Error("Unable to Initialize DataBlockTypeCache");
                return;
            }
            if (!PartialDataManager.Initialize())
            {
                Logger.Error("Unable to Initialize PartialData");
                return;
            }

            PersistentIDManager.DumpToFile(Path.Combine(PartialDataManager.PartialDataPath, "_persistentID.json"));
            AssetShardManager.add_OnStartupAssetsLoaded((Il2CppSystem.Action)OnAssetLoaded);

            var harmony = new Harmony("MTFO.pBlock.Harmony");

            harmony.PatchAll();
        }
Exemplo n.º 2
0
        public override void Load()
        {
            log = Log;
            Log.LogMessage("Application Start");
            ClassInjector.RegisterTypeInIl2Cpp <LightManager>();
            ClassInjector.RegisterTypeInIl2Cpp <InvoidableManager>();
            ClassInjector.RegisterTypeInIl2Cpp <InvoidableEndTrigger>();
            ClassInjector.RegisterTypeInIl2Cpp <ElevatorLight>();

            var harmony = new Harmony(GUID);

            harmony.PatchAll();

            AssetShardManager.add_OnEnemyAssetsLoaded((Action)(() =>
            {
                GameObject shooterProjectile = AssetShardManager.GetLoadedAsset <GameObject>("Assets/AssetPrefabs/Characters/Enemies/Abilities/ProjTargetingSmall.prefab", false);
                GameObject hybridProjectile = AssetShardManager.GetLoadedAsset <GameObject>("Assets/AssetPrefabs/Characters/Enemies/Abilities/ProjSemiTargetingQuick.prefab", false);

                AssetShardManager.GetLoadedAsset <GameObject>("Assets/AssetPrefabs/Characters/Enemies/Abilities/ProjTargetingSmall.prefab", false);
                ProjectileBase projectile = shooterProjectile.GetComponent <ProjectileBase>();
                ProjectileBase hybrid = hybridProjectile.GetComponent <ProjectileBase>();
                projectile.m_maxDamage = 1.0f;
                hybrid.m_maxDamage = 2f;
            }));
        }