mirror of
https://github.com/HighCapable/YukiHookAPI.git
synced 2025-09-06 02:35:40 +08:00
...
This commit is contained in:
@@ -116,14 +116,14 @@ class FieldFinder(private val hookInstance: YukiHookCreater.MemberHookCreater, p
|
|||||||
* @param instance 变量所在的实例对象 - 如果是静态可不填 - 默认 null
|
* @param instance 变量所在的实例对象 - 如果是静态可不填 - 默认 null
|
||||||
* @return [Instance]
|
* @return [Instance]
|
||||||
*/
|
*/
|
||||||
fun get(instance: Any? = null) = Instance(give()?.get(instance))
|
fun get(instance: Any? = null) = Instance(instance, give()?.get(instance))
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 得到变量实例
|
* 得到变量实例
|
||||||
* @param instance 变量所在的实例对象 - 如果是静态可不填 - 默认 null
|
* @param instance 变量所在的实例对象 - 如果是静态可不填 - 默认 null
|
||||||
* @return [T] or null
|
* @return [T] or null
|
||||||
*/
|
*/
|
||||||
fun <T> of(instance: Any? = null) = get(instance) as? T?
|
fun <T> of(instance: Any? = null) = get(instance).self as? T?
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 得到变量本身
|
* 得到变量本身
|
||||||
@@ -143,9 +143,10 @@ class FieldFinder(private val hookInstance: YukiHookCreater.MemberHookCreater, p
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* [Field] 实例变量处理类
|
* [Field] 实例变量处理类
|
||||||
* @param instance 当前 [Field] 的实例对象
|
* @param instance 当前 [Field] 所在类的实例对象
|
||||||
|
* @param self 当前 [Field] 自身的实例对象
|
||||||
*/
|
*/
|
||||||
inner class Instance(val instance: Any?) {
|
inner class Instance(private val instance: Any?, val self: Any?) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置变量实例
|
* 设置变量实例
|
||||||
|
Reference in New Issue
Block a user