Exemple #1
0
        private void TitleMusicIL(ILContext il)
        {
            ILCursor ilcursor  = new ILCursor(il);
            ILCursor ilcursor2 = ilcursor;
            MoveType moveType  = MoveType.After;

            Func <Instruction, bool>[] array = new Func <Instruction, bool> [1];
            array[0] = ((Instruction i) => ILPatternMatchingExt.MatchLdfld <Main>(i, "newMusic"));
            ilcursor2.GotoNext(moveType, array);
            ilcursor.EmitDelegate <Func <int, int> >(delegate(int newMusic)
            {
                if (newMusic != 6)
                {
                    return(newMusic);
                }
                return(customTitleMusicSlot);
            });
        }