Files
Assembly-CSharp/Assembly-CSharp/KaleidxScopeFadeState.cs
2026-06-12 12:58:31 +08:00

321 lines
11 KiB
C#

using System;
using System.Collections.Generic;
using Mai2.Mai2Cue;
using MAI2.Util;
using MAI2System;
using Manager;
using Manager.MaiStudio;
using Process;
// Token: 0x0200015A RID: 346
public class KaleidxScopeFadeState : StateMachineBase<KaleidxScopeFadeState, KaleidxScopeFadeState.StateType>
{
// Token: 0x1700013C RID: 316
// (get) Token: 0x06000C54 RID: 3156 RVA: 0x00039ABF File Offset: 0x00038CBF
// (set) Token: 0x06000C53 RID: 3155 RVA: 0x00039AB6 File Offset: 0x00038CB6
public bool canRelease { get; private set; }
// Token: 0x06000C55 RID: 3157 RVA: 0x00039AC8 File Offset: 0x00038CC8
public void Initalize(ProcessDataContainer _container, ProcessBase _fromProcess, ProcessBase _toProcess, List<KaleidxScopeFadeController> _mainControllerList, List<KaleidxScopeSubFadeController> _subControllerList, bool _isReleaseCustomMaterial)
{
this.container = _container;
this.mainControllerList = _mainControllerList;
this.subControllerList = _subControllerList;
this.fromProcess = _fromProcess;
this.toProcess = _toProcess;
this.isReleaseCustomMaterial = _isReleaseCustomMaterial;
this.canRelease = false;
base.ChangeState(new KaleidxScopeFadeState.FadeIn(this, KaleidxScopeFadeState.StateType.FadeIn));
}
// Token: 0x06000C56 RID: 3158 RVA: 0x00039B18 File Offset: 0x00038D18
public void ProcessingProcess()
{
if (!this.isAddProcess)
{
if (this.fromProcess != null)
{
this.container.processManager.ReleaseProcess(this.fromProcess);
}
if (this.isReleaseCustomMaterial)
{
CustomMaterial.RemoveAll();
}
SystemConfig.unloadUnusedAndGC();
if (this.toProcess != null)
{
this.container.processManager.AddProcess(this.toProcess, 20);
}
this.isAddProcess = true;
}
}
// Token: 0x040009AC RID: 2476
private List<KaleidxScopeFadeController> mainControllerList = new List<KaleidxScopeFadeController>();
// Token: 0x040009AD RID: 2477
private List<KaleidxScopeSubFadeController> subControllerList = new List<KaleidxScopeSubFadeController>();
// Token: 0x040009AE RID: 2478
private ProcessDataContainer container;
// Token: 0x040009AF RID: 2479
protected ProcessBase fromProcess;
// Token: 0x040009B0 RID: 2480
protected ProcessBase toProcess;
// Token: 0x040009B1 RID: 2481
protected bool isReleaseCustomMaterial = true;
// Token: 0x040009B2 RID: 2482
protected bool isAddProcess;
// Token: 0x040009B4 RID: 2484
public bool[] isEntry = new bool[2];
// Token: 0x040009B5 RID: 2485
public KaleidxScopeManager.KaleidxScopePhase[] kaleidxPhase = new KaleidxScopeManager.KaleidxScopePhase[2];
// Token: 0x02000A14 RID: 2580
public enum StateType
{
// Token: 0x040062F3 RID: 25331
FadeIn,
// Token: 0x040062F4 RID: 25332
WaitLoad,
// Token: 0x040062F5 RID: 25333
FadeOut,
// Token: 0x040062F6 RID: 25334
Release
}
// Token: 0x02000A15 RID: 2581
public class FadeIn : StateBase<KaleidxScopeFadeState, KaleidxScopeFadeState.StateType>
{
// Token: 0x06004DBA RID: 19898 RVA: 0x0019D687 File Offset: 0x0019C887
public FadeIn(KaleidxScopeFadeState _stateMachine, KaleidxScopeFadeState.StateType _enumState)
: base(_stateMachine, _enumState)
{
}
// Token: 0x06004DBB RID: 19899 RVA: 0x0019D694 File Offset: 0x0019C894
public override void OnEnter()
{
int gateId = Singleton<KaleidxScopeManager>.Instance.gateId;
for (int i = 0; i < 2; i++)
{
UserData userData = Singleton<UserDataManager>.Instance.GetUserData((long)i);
this.stateMachine.isEntry[i] = userData.IsEntry;
this.stateMachine.kaleidxPhase[i] = Singleton<KaleidxScopeManager>.Instance.GetUserKaleidxScopePhase(userData);
if (this.stateMachine.kaleidxPhase[i] == KaleidxScopeManager.KaleidxScopePhase.AllClear)
{
if (!Singleton<KaleidxScopeManager>.Instance.watchedBackGroundSwitchingScene[i])
{
this.stateMachine.kaleidxPhase[i] = KaleidxScopeManager.KaleidxScopePhase.LastBoss;
}
}
else if (this.stateMachine.kaleidxPhase[i] == KaleidxScopeManager.KaleidxScopePhase.CenterTowerCleared && !Singleton<KaleidxScopeManager>.Instance.watchedBackGroundSwitchingScene[i])
{
this.stateMachine.kaleidxPhase[i] = KaleidxScopeManager.KaleidxScopePhase.FoundCenterTower;
}
}
bool flag = false;
for (int j = 0; j < 2; j++)
{
int num = j;
if (!this.stateMachine.isEntry[j])
{
num = ((j == 0) ? 1 : 0);
}
if (Singleton<KaleidxScopeManager>.Instance.IsExTrack && !Singleton<KaleidxScopeManager>.Instance.IsExTrackPlayed)
{
flag = true;
this.stateMachine.mainControllerList[j].PlayAnimation(KaleidxScopeFadeController.AnimState.ED_in);
this.stateMachine.subControllerList[j].PlayAnimation(KaleidxScopeSubFadeController.AnimState.ED_in);
}
else
{
KaleidxScopeFadeController kaleidxScopeFadeController = this.stateMachine.mainControllerList[j];
KaleidxScopeSubFadeController kaleidxScopeSubFadeController = this.stateMachine.subControllerList[j];
if (Singleton<KaleidxScopeManager>.Instance.IsBlackOutFade)
{
kaleidxScopeFadeController.PlayAnimation(KaleidxScopeFadeController.AnimState.Black_in);
kaleidxScopeSubFadeController.PlayAnimation(KaleidxScopeSubFadeController.AnimState.Black_in);
}
else
{
KaleidxScopeFadeController.SpriteType spriteType = KaleidxScopeFadeController.ConvertgateIdToSpriteType(gateId);
KaleidxScopeFadeController.BackGroundType backGroundType = KaleidxScopeFadeController.ConvertPhaseIdToBackGroundType(this.stateMachine.kaleidxPhase[num]);
kaleidxScopeFadeController.SetSpriteType(spriteType);
kaleidxScopeFadeController.SetBackGroundType(backGroundType);
kaleidxScopeFadeController.PlayAnimation(KaleidxScopeFadeController.AnimState.In);
KaleidxScopeSubFadeController.SpriteType spriteType2 = KaleidxScopeSubFadeController.ConvertgateIdToSpriteType(gateId);
KaleidxScopeSubFadeController.BackGroundType backGroundType2 = KaleidxScopeSubFadeController.ConvertPhaseIdToBackGroundType(this.stateMachine.kaleidxPhase[num]);
kaleidxScopeSubFadeController.SetSpriteType(spriteType2);
kaleidxScopeSubFadeController.SetBackGroundType(backGroundType2);
kaleidxScopeSubFadeController.PlayAnimation(KaleidxScopeSubFadeController.AnimState.In);
}
}
}
if (Singleton<KaleidxScopeManager>.Instance.IsBlackOutFade)
{
Singleton<KaleidxScopeManager>.Instance.IsBlackOutFade = false;
}
if (flag)
{
for (int k = 0; k < 2; k++)
{
SoundManager.PlaySE(Cue.SE_KALEID_THANK_YOU_FOR_PLAYING, k);
}
Singleton<KaleidxScopeManager>.Instance.SetIsExTrackPlayed(true);
}
}
// Token: 0x06004DBC RID: 19900 RVA: 0x0019D8D4 File Offset: 0x0019CAD4
public override void OnUpdate()
{
for (int i = 0; i < 2; i++)
{
if (!this.stateMachine.mainControllerList[i].PlayEnded())
{
return;
}
if (!this.stateMachine.subControllerList[i].PlayEnded())
{
return;
}
}
this.stateMachine.ChangeState(new KaleidxScopeFadeState.WaitLoad(this.stateMachine, KaleidxScopeFadeState.StateType.WaitLoad));
}
// Token: 0x06004DBD RID: 19901 RVA: 0x0019D937 File Offset: 0x0019CB37
public override void OnExit()
{
base.OnExit();
}
}
// Token: 0x02000A16 RID: 2582
public class WaitLoad : StateBase<KaleidxScopeFadeState, KaleidxScopeFadeState.StateType>
{
// Token: 0x06004DBE RID: 19902 RVA: 0x0019D687 File Offset: 0x0019C887
public WaitLoad(KaleidxScopeFadeState _stateMachine, KaleidxScopeFadeState.StateType _enumState)
: base(_stateMachine, _enumState)
{
}
// Token: 0x06004DBF RID: 19903 RVA: 0x0019D93F File Offset: 0x0019CB3F
public override void OnEnter()
{
this.stateMachine.ProcessingProcess();
}
// Token: 0x06004DC0 RID: 19904 RVA: 0x00003598 File Offset: 0x00002798
public override void OnUpdate()
{
}
// Token: 0x06004DC1 RID: 19905 RVA: 0x0019D937 File Offset: 0x0019CB37
public override void OnExit()
{
base.OnExit();
}
}
// Token: 0x02000A17 RID: 2583
public class FadeOut : StateBase<KaleidxScopeFadeState, KaleidxScopeFadeState.StateType>
{
// Token: 0x06004DC2 RID: 19906 RVA: 0x0019D94C File Offset: 0x0019CB4C
public FadeOut(KaleidxScopeFadeState _stateMachine, KaleidxScopeFadeState.StateType _enumState, bool isLastTrackFade = false)
: base(_stateMachine, _enumState)
{
this._isLastTrackFade = isLastTrackFade;
}
// Token: 0x06004DC3 RID: 19907 RVA: 0x0019D964 File Offset: 0x0019CB64
public override void OnEnter()
{
KaleidxScopeFadeController.AnimState animState = (this._isLastTrackFade ? KaleidxScopeFadeController.AnimState.Out_02 : KaleidxScopeFadeController.AnimState.Out);
for (int i = 0; i < 2; i++)
{
if (Singleton<KaleidxScopeManager>.Instance.IsExTrack)
{
this.stateMachine.mainControllerList[i].PlayAnimation(KaleidxScopeFadeController.AnimState.ED_out);
this.stateMachine.subControllerList[i].PlayAnimation(KaleidxScopeSubFadeController.AnimState.ED_out);
}
else
{
if (this._isLastTrackFade && Singleton<KaleidxScopeManager>.Instance.IsEqualsGateType(GateTypeID.Boss))
{
animState = KaleidxScopeFadeController.AnimState.Out_03;
}
this.stateMachine.mainControllerList[i].PlayAnimation(animState);
this.stateMachine.subControllerList[i].PlayAnimation(KaleidxScopeSubFadeController.AnimState.Out);
}
}
}
// Token: 0x06004DC4 RID: 19908 RVA: 0x0019DA14 File Offset: 0x0019CC14
public override void OnUpdate()
{
if (this.waitFrame)
{
this.waitFrame = false;
return;
}
for (int i = 0; i < 2; i++)
{
if (!this.stateMachine.mainControllerList[i].PlayEnded())
{
return;
}
if (!this.stateMachine.subControllerList[i].PlayEnded())
{
return;
}
}
this.stateMachine.ChangeState(new KaleidxScopeFadeState.Release(this.stateMachine, KaleidxScopeFadeState.StateType.Release));
}
// Token: 0x06004DC5 RID: 19909 RVA: 0x0019DA87 File Offset: 0x0019CC87
public override void OnExit()
{
this.stateMachine.canRelease = true;
base.OnExit();
}
// Token: 0x040062F7 RID: 25335
private bool waitFrame = true;
// Token: 0x040062F8 RID: 25336
private bool _isLastTrackFade;
}
// Token: 0x02000A18 RID: 2584
public class Release : StateBase<KaleidxScopeFadeState, KaleidxScopeFadeState.StateType>
{
// Token: 0x06004DC6 RID: 19910 RVA: 0x0019D687 File Offset: 0x0019C887
public Release(KaleidxScopeFadeState _stateMachine, KaleidxScopeFadeState.StateType _enumState)
: base(_stateMachine, _enumState)
{
}
// Token: 0x06004DC7 RID: 19911 RVA: 0x00003598 File Offset: 0x00002798
public override void OnEnter()
{
}
// Token: 0x06004DC8 RID: 19912 RVA: 0x00003598 File Offset: 0x00002798
public override void OnUpdate()
{
}
// Token: 0x06004DC9 RID: 19913 RVA: 0x0019D937 File Offset: 0x0019CB37
public override void OnExit()
{
base.OnExit();
}
}
}