File tree 1 file changed +13
-1
lines changed
1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -32,8 +32,20 @@ public void Reload()
32
32
// 实现了重载切换ExampleTrait的action_special_effect
33
33
_reload_switch = ! _reload_switch ;
34
34
var example_trait_to_update = AssetManager . traits . get ( "ExampleTrait" ) ;
35
- example_trait_to_update . action_special_effect = _reload_switch ? ExampleActions . example_trait_special_effect : null ;
35
+ example_trait_to_update . action_special_effect = _reload_switch
36
+ ? ExampleActions . example_trait_special_effect
37
+ : [ Hotfixable ] ( pTarget , pTile ) =>
38
+ {
39
+ // 用于重载的匿名函数示例
40
+ if ( pTarget != null ) return false ;
41
+ // You can modify the method when game running. And click the reload button in the mod menu to reload the method.
42
+ // 你可以在游戏运行时修改方法,然后点击mod菜单中的reload按钮来重新加载方法。
43
+ ExampleModMain . LogInfo ( $ "lambda function called") ;
44
+ return true ;
45
+ } ;
36
46
example_trait_to_update . special_effect_interval = 1f ;
47
+ // 重载匿名函数示例
48
+ if ( ! _reload_switch ) example_trait_to_update . action_special_effect ( null , null ) ;
37
49
38
50
// 将特质的效果更新即时应用于所有单位.
39
51
foreach ( var actor in World . world . units ) {
You can’t perform that action at this time.
0 commit comments