コード例 #1
0
        internal static void InitHooks()
        {
            // late hook.
            On.RoR2.PreGameController.Awake += (origAwake, selfPreGameController) => {
                origAwake(selfPreGameController);

                On.RoR2.RuleBook.ApplyChoice += (orig, self, def) => {
                    orig(self, def);

                    UpdateValues?.Invoke(self, null);
                };
            };
        }
コード例 #2
0
ファイル: LobbyConfigAPI.cs プロジェクト: Jarlyk/R2API
        private static void _hookApplyChoice_RuleBook(On.RoR2.RuleBook.orig_ApplyChoice orig, RuleBook self, RuleChoiceDef choiceDef)
        {
            orig(self, choiceDef);

            UpdateValues?.Invoke(self, choiceDef);
        }