1+ using Il2CppAssets . Scripts . PeroTools . Commons ;
2+ using Il2CppFormulaBase ;
3+ using Il2CppSpine ;
4+ using Il2CppSpine . Unity ;
5+ using System . Collections . Concurrent ;
6+ using UnityEngine ;
7+
8+ namespace FadeIn
9+ {
10+ internal static class ModManager
11+ {
12+ internal static bool _enabled ;
13+ public static bool Enabled
14+ {
15+ get { return _enabled ; }
16+ set
17+ {
18+ _enabled = value ;
19+ if ( _enabled )
20+ {
21+ OnSceneWasLoadedFunc = ClearSceneElements ;
22+ EnableVisiblePatch = EnqueueSkeleton ;
23+ OnUpdateFunc = UpdateQueueElements ;
24+ }
25+ else
26+ {
27+ OnSceneWasLoadedFunc = ( ) => { } ;
28+ EnableVisiblePatch = ( _ ) => { } ;
29+ OnUpdateFunc = ( ) => { } ;
30+ }
31+ }
32+ }
33+
34+ public static GameObject FadeToggle = null ;
35+
36+ public static bool battleScene = false ;
37+ public static readonly ConcurrentQueue < Skeleton > enemiesSkeletons = new ( ) ;
38+
39+ internal delegate void OnSceneWasLoadedFuncType ( ) ;
40+ public static OnSceneWasLoadedFuncType OnSceneWasLoadedFunc ;
41+
42+ internal delegate void EnableVisiblePatchFuncType ( GameObject beoc ) ;
43+ public static EnableVisiblePatchFuncType EnableVisiblePatch ;
44+
45+ internal delegate void OnUpdateFuncType ( ) ;
46+ public static OnUpdateFuncType OnUpdateFunc ;
47+
48+ public static readonly float frequency = 1f / Time . fixedDeltaTime ;
49+
50+ internal static void ClearSceneElements ( )
51+ {
52+ enemiesSkeletons . Clear ( ) ;
53+ }
54+
55+ internal static void EnqueueSkeleton ( GameObject beoc )
56+ {
57+ Skeleton currentEnemySkeleton = beoc . GetComponent < SkeletonAnimation > ( ) . skeleton ;
58+ currentEnemySkeleton . a = 0.7f ;
59+ enemiesSkeletons . Enqueue ( currentEnemySkeleton ) ;
60+ // Check airmusicnodecontroller for note particles
61+ }
62+
63+ internal static void UpdateQueueElements ( )
64+ {
65+ StageBattleComponent sbc = Singleton < StageBattleComponent > . instance ;
66+ if ( ( ! sbc ? . isInGame ?? true ) || ( sbc ? . isPause ?? true ) ) return ;
67+ float delta = 0.01f * frequency * Time . deltaTime ;
68+
69+ foreach ( Skeleton skeleton in enemiesSkeletons )
70+ {
71+ skeleton . a -= delta ;
72+ if ( skeleton . a <= 0 )
73+ {
74+ skeleton . a = 0f ;
75+ enemiesSkeletons . TryDequeue ( out _ ) ;
76+ }
77+ }
78+ }
79+ }
80+ }
0 commit comments