コード例 #1
0
        public static void OnTransformEnd(Terraria.NPC npc, int newType)
        {
            var ctx = new HookContext();
            var args = new HookArgs.NpcTransform()
            {
                State = MethodState.End,
                NewType = newType,

                Npc = npc
            };

            HookPoints.NpcTransform.Invoke(ref ctx, ref args);
        }
コード例 #2
0
        public static bool OnTransformBegin(Terraria.NPC npc, int newType)
        {
            var ctx = new HookContext();
            var args = new HookArgs.NpcTransform()
            {
                State = MethodState.Begin,
                NewType = newType,

                Npc = npc
            };

            HookPoints.NpcTransform.Invoke(ref ctx, ref args);

            return ctx.Result == HookResult.DEFAULT;
        }