Пример #1
0
        public override void Load()
        {
            if (Main.netMode != NetmodeID.Server)
            {
                customizerUI = new CustomizerUI();
                customizerUI.Activate();
                customizerInterface = new UserInterface();
                customizerInterface.SetState(customizerUI);
            }

            //Here, have some absolute black magic. It's fun being a wizard! Or not.
            //Record created dusts for shading later
            On.Terraria.Dust.NewDust += Dust_Capture;

            //Capture dusts from projectile updates
            On.Terraria.Projectile.Update += Proj_Update;

            //Attempt to skip NPC hit/death dusts
            On.Terraria.NPC.VanillaHitEffect += NPC_SkipHit;

            ShaderLoader.RegisterMod(this);

            mod = this;
            CustomizerProjectile.newProjectiles   = new List <Projectile>();
            CustomizerProjectile.childProjectiles = new List <Projectile>();
            CustomizerProjectile.newDusts         = new List <int>();
            CustomizerProjectile.tempDusts        = new List <int>();
        }
Пример #2
0
        public override void Unload()
        {
            On.Terraria.Dust.NewDust         -= Dust_Capture;
            On.Terraria.Projectile.Update    -= Proj_Update;
            On.Terraria.NPC.VanillaHitEffect -= NPC_SkipHit;

            mod = null;
            CustomizerProjectile.newProjectiles   = null;
            CustomizerProjectile.childProjectiles = null;
            CustomizerProjectile.newDusts         = null;
            CustomizerProjectile.tempDusts        = null;
        }