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

133 lines
3.7 KiB
C#

using System;
using System.Collections.Generic;
using MAI2.Util;
using Manager;
using Process;
using UnityEngine;
// Token: 0x0200015B RID: 347
public class KaleidxScopeProcess : ProcessBase
{
// Token: 0x06000C58 RID: 3160 RVA: 0x00039BC2 File Offset: 0x00038DC2
public KaleidxScopeProcess(ProcessDataContainer dataContainer)
: base(dataContainer)
{
}
// Token: 0x06000C59 RID: 3161 RVA: 0x00003598 File Offset: 0x00002798
public override void OnAddProcess()
{
}
// Token: 0x06000C5A RID: 3162 RVA: 0x00039BE4 File Offset: 0x00038DE4
public override void OnStart()
{
GameManager.IsCoinAcceptable = false;
GameObject gameObject = Resources.Load<GameObject>("Process/KaleidxScope/KaleidCourseSelectProcess");
for (int i = 0; i < 2; i++)
{
UserData userData = Singleton<UserDataManager>.Instance.GetUserData((long)i);
KaleidxScopeMonitor component = base.CreateInstanceAndSetParent(gameObject, (i == 0) ? this.container.LeftMonitor : this.container.RightMonitor).GetComponent<KaleidxScopeMonitor>();
component.Initialize(i, userData.IsEntry);
this.monitorList.Add(component);
}
this.stateMachine.manualUpdate = true;
this.stateMachine.Initalize(this.monitorList, this.container);
this.setTimer = false;
this.timeUp = false;
this.changedProcess = false;
}
// Token: 0x06000C5B RID: 3163 RVA: 0x00039C94 File Offset: 0x00038E94
public override void OnUpdate()
{
bool flag = this.setTimer;
this.setTimer = this.stateMachine.setTimer;
if (this.setTimer && !flag)
{
this.SetTimer();
}
else if (!this.setTimer && flag)
{
this.SetVisibleTimer(false);
}
this.stateMachine.ManualUpdate();
}
// Token: 0x06000C5C RID: 3164 RVA: 0x00039CEC File Offset: 0x00038EEC
public override void OnLateUpdate()
{
bool flag = this.timeUp;
this.timeUp = this.stateMachine.timeUp;
if (this.timeUp && !flag)
{
for (int i = 0; i < 2; i++)
{
this.container.processManager.SetVisibleTimer(i, false);
}
}
if (this.stateMachine.moveToDifficultySelect && !this.changedProcess)
{
this.changedProcess = true;
this.container.processManager.AddProcess(new KaleidxScopeFadeProcess(this.container, this, new KaleidxScopeSelectDifficultyProcess(this.container), true), 50);
}
}
// Token: 0x06000C5D RID: 3165 RVA: 0x00039D84 File Offset: 0x00038F84
public override void OnRelease()
{
foreach (KaleidxScopeMonitor kaleidxScopeMonitor in this.monitorList)
{
Object.Destroy(kaleidxScopeMonitor.gameObject);
}
this.monitorList.Clear();
}
// Token: 0x06000C5E RID: 3166 RVA: 0x00039DE4 File Offset: 0x00038FE4
public KaleidxScopeState.StateType GetCurrentState()
{
return this.stateMachine.GetCurrentState();
}
// Token: 0x06000C5F RID: 3167 RVA: 0x00039DF4 File Offset: 0x00038FF4
public void SetVisibleTimer(bool isActive)
{
this.setTimer = isActive;
for (int i = 0; i < 2; i++)
{
this.container.processManager.SetVisibleTimer(i, isActive);
}
}
// Token: 0x06000C60 RID: 3168 RVA: 0x00039E28 File Offset: 0x00039028
private void SetTimer()
{
this.container.processManager.PrepareTimer(30, 0, false, new Action(this.TimeUp), true);
for (int i = 0; i < 2; i++)
{
this.container.processManager.SetVisibleTimer(i, this.monitorList[i].entry);
}
}
// Token: 0x06000C61 RID: 3169 RVA: 0x00039E84 File Offset: 0x00039084
private void TimeUp()
{
this.stateMachine.timeUp = true;
}
// Token: 0x040009B6 RID: 2486
private KaleidxScopeState stateMachine = new KaleidxScopeState();
// Token: 0x040009B7 RID: 2487
private List<KaleidxScopeMonitor> monitorList = new List<KaleidxScopeMonitor>();
// Token: 0x040009B8 RID: 2488
private bool setTimer;
// Token: 0x040009B9 RID: 2489
private bool timeUp;
// Token: 0x040009BA RID: 2490
private bool changedProcess;
}