17 lines
1.2 KiB
Python
17 lines
1.2 KiB
Python
from pathlib import Path
|
|
s=Path('Client/Assets/Scripts/Stages/FishingAct.cs').read_text(encoding='utf-8-sig')
|
|
start=s.index('async System.Threading.Tasks.Task LoadMapByCurID()')
|
|
end=s.index('mapObjPrefab = loadedMapPrefab;',start)+len('mapObjPrefab = loadedMapPrefab;')
|
|
prefix=s[start:end].replace('async System.Threading.Tasks.Task LoadMapByCurID()', 'public async Task Run()')
|
|
code='using System;using System.Threading.Tasks;public partial class Subject {\n'+prefix+'\nApplied=true; }\n}\n'
|
|
s=Path('Client/Assets/Scripts/GampPlay/FishingB/FishingBehaviorB.cs').read_text(encoding='utf-8-sig')
|
|
start=s.index('void SetIKTarget(Transform target)');a=s.index('{',start);n=1;end=a+1
|
|
while n:
|
|
n+=(s[end]=='{')-(s[end]=='}');end+=1
|
|
code+='public partial class IkSubject {public '+s[start:end]+'\n}\n'
|
|
s=Path('Client/Assets/Scripts/Stages/FishingStage.cs').read_text(encoding='utf-8-sig')
|
|
start=s.index('try { await base.StartAsync(); }')
|
|
end=s.index('//静默加载后续场景',start)
|
|
code+='public partial class StageSubject : StageBase { public async Task Run(){ var loginLifetime=Lifetime.Token;\n'+s[start:end]+'\nCompleted=true; } }\n'
|
|
Path('CodexOutput/upserver/MapExitTests/Generated.cs').write_text(code,encoding='utf-8')
|