跳转到帖子
View in the app

A better way to browse. Learn more.

网域社区-让世界触手可及

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
欢迎来到网域社区,网域社区以延续互联网共享精神为荣!我们免费分享开心版(破解版)软件、php源码等;

推荐的帖子

发布于

导语:在一些通用的方法下,你要都需要进行一定的敌我判断,不能让除玩家外的对象享受到mod功能

常用方法为:挂钩实例方法(int、bool)传入实例进行判断确定、第二是从字段(在dnspy中为黄色)中找到同类里的枚举字段或者疑似的字段(int、bool为普通类型蓝色)进行判断,第三个是我们自写的c++适配器代码,这个需对逻辑与c++语言有一定的基础,这里我们用到的是第二种方法,我们就找到了一个疑似字段,int类型的instanceid。

由于不像枚举一般有给我提供对应类型的返回值,所以我们可以通挂钩通用方法,比如这里我挂钩了伤害方法,敌人玩家受到伤害都会从这里走一遍逻辑

rBAAdmcTktSADRfqAAAlcRnw_N0635.png

挂钩代码如下:

逻辑解析

当伤害代码被调用时将实例传入字段进行判断为1时就是玩家。

为何为1:通过logd进行打印isplayer的值,每次方法执行时都会在as控制台自动打印出玩家和敌人的实例值

rBAAdmcTktWAdg81AACgUOyZ4RM777.png

像这样子,然后填入即可完成一次简单的判断

rBAAdmcTktWAFM1OAAAaMrFI3Tc545.png

简单结束[滑稽]有缘再见

参与讨论

你可以现在发布并稍后注册. 如果你有帐户,现在就登录发布帖子.

游客
回帖…

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.