282 lines
7.5 KiB
C#
282 lines
7.5 KiB
C#
using System;
|
|
using MAI2System;
|
|
using Manager;
|
|
using Process;
|
|
using UI;
|
|
using UnityEngine;
|
|
|
|
// Token: 0x02000153 RID: 339
|
|
public class FadeProcess : ProcessBase
|
|
{
|
|
// Token: 0x06000BFA RID: 3066 RVA: 0x00037890 File Offset: 0x00036A90
|
|
public FadeProcess(ProcessDataContainer dataContainer, ProcessBase from)
|
|
: base(dataContainer, ProcessType.FadeProcess)
|
|
{
|
|
this.fromProcess = from;
|
|
this.toProcess = null;
|
|
}
|
|
|
|
// Token: 0x06000BFB RID: 3067 RVA: 0x000378F0 File Offset: 0x00036AF0
|
|
public FadeProcess(ProcessDataContainer dataContainer, ProcessBase from, ProcessBase to)
|
|
: base(dataContainer, ProcessType.FadeProcess)
|
|
{
|
|
this.fromProcess = from;
|
|
this.toProcess = to;
|
|
this.fadeType = FadeProcess.FadeType.Type1;
|
|
}
|
|
|
|
// Token: 0x06000BFC RID: 3068 RVA: 0x00037958 File Offset: 0x00036B58
|
|
public FadeProcess(ProcessDataContainer dataContainer, ProcessBase from, ProcessBase to, bool releaseCustomMaterial)
|
|
: base(dataContainer, ProcessType.FadeProcess)
|
|
{
|
|
this.fromProcess = from;
|
|
this.toProcess = to;
|
|
this.fadeType = FadeProcess.FadeType.Type1;
|
|
this.isReleaseCustomMaterial = releaseCustomMaterial;
|
|
}
|
|
|
|
// Token: 0x06000BFD RID: 3069 RVA: 0x000379C8 File Offset: 0x00036BC8
|
|
public FadeProcess(ProcessDataContainer dataContainer, ProcessBase from, ProcessBase to, int monitorIndex = -1)
|
|
: base(dataContainer, ProcessType.FadeProcess)
|
|
{
|
|
this.fromProcess = from;
|
|
this.toProcess = to;
|
|
this.fadeType = FadeProcess.FadeType.Type1;
|
|
this._restartPleaseWaitID = monitorIndex;
|
|
}
|
|
|
|
// Token: 0x06000BFE RID: 3070 RVA: 0x00037A38 File Offset: 0x00036C38
|
|
public FadeProcess(ProcessDataContainer dataContainer, ProcessBase from, ProcessBase to, FadeProcess.FadeType type)
|
|
: base(dataContainer, ProcessType.FadeProcess)
|
|
{
|
|
this.fromProcess = from;
|
|
this.toProcess = to;
|
|
this.fadeType = type;
|
|
}
|
|
|
|
// Token: 0x06000BFF RID: 3071 RVA: 0x00003598 File Offset: 0x00002798
|
|
public override void OnAddProcess()
|
|
{
|
|
}
|
|
|
|
// Token: 0x06000C00 RID: 3072 RVA: 0x00037AA0 File Offset: 0x00036CA0
|
|
public override void OnStart()
|
|
{
|
|
GameObject gameObject = Resources.Load<GameObject>("Process/Fade/FadeProcess");
|
|
this.fadeObject[0] = base.CreateInstanceAndSetParent(gameObject, this.container.LeftMonitor);
|
|
this.fadeObject[1] = base.CreateInstanceAndSetParent(gameObject, this.container.RightMonitor);
|
|
GameObject gameObject2 = Resources.Load<GameObject>("Process/ChangeScreen/Prefabs/ChangeScreen_02");
|
|
GameObject gameObject3 = Resources.Load<GameObject>("Process/ChangeScreen/Prefabs/Sub_ChangeScreen");
|
|
for (int i = 0; i < 2; i++)
|
|
{
|
|
this.canvasObject[i, 0] = base.CreateInstanceAndSetParent(gameObject2, this.fadeObject[i].transform.Find("Canvas/Main"));
|
|
this.canvasObject[i, 1] = base.CreateInstanceAndSetParent(gameObject3, this.fadeObject[i].transform.Find("Canvas/Sub"));
|
|
this.canvasObject[i, 1].transform.GetChild(0).GetComponent<MultipleImage>().ChangeSprite(1);
|
|
for (int j = 0; j < 2; j++)
|
|
{
|
|
this.animator[i, j] = this.canvasObject[i, j].GetComponent<Animator>();
|
|
}
|
|
}
|
|
this.isFadeing = true;
|
|
}
|
|
|
|
// Token: 0x06000C01 RID: 3073 RVA: 0x00003598 File Offset: 0x00002798
|
|
public override void OnUpdate()
|
|
{
|
|
}
|
|
|
|
// Token: 0x06000C02 RID: 3074 RVA: 0x00037BCC File Offset: 0x00036DCC
|
|
public virtual 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: 0x06000C03 RID: 3075 RVA: 0x00037C3C File Offset: 0x00036E3C
|
|
public override void OnLateUpdate()
|
|
{
|
|
if (this.isFadeing)
|
|
{
|
|
AnimatorStateInfo currentAnimatorStateInfo = this.animator[1, 0].GetCurrentAnimatorStateInfo(0);
|
|
switch (this.state)
|
|
{
|
|
case FadeProcess.FadeState.DoFadeOut:
|
|
if (3 < this._counter)
|
|
{
|
|
for (int i = 0; i < 2; i++)
|
|
{
|
|
for (int j = 0; j < 2; j++)
|
|
{
|
|
this.animator[i, j].SetTrigger("In");
|
|
}
|
|
}
|
|
this._counter = 0;
|
|
this.state = FadeProcess.FadeState.FadeOut;
|
|
return;
|
|
}
|
|
this._counter++;
|
|
return;
|
|
case FadeProcess.FadeState.FadeOut:
|
|
if (!currentAnimatorStateInfo.IsName("In"))
|
|
{
|
|
if (this._restartPleaseWaitID >= 0)
|
|
{
|
|
int restartPleaseWaitID = this._restartPleaseWaitID;
|
|
if (restartPleaseWaitID != 0)
|
|
{
|
|
if (restartPleaseWaitID == 1)
|
|
{
|
|
this.container.processManager.SendMessage(new Message(ProcessType.PleaseWaitProcess, 20006, Array.Empty<object>()));
|
|
}
|
|
}
|
|
else
|
|
{
|
|
this.container.processManager.SendMessage(new Message(ProcessType.PleaseWaitProcess, 20005, Array.Empty<object>()));
|
|
}
|
|
this._restartPleaseWaitID = -1;
|
|
}
|
|
this.ProcessingProcess();
|
|
this.isFadeing = false;
|
|
return;
|
|
}
|
|
break;
|
|
case FadeProcess.FadeState.DoFadeIn:
|
|
if (3 < this._counter)
|
|
{
|
|
for (int k = 0; k < 2; k++)
|
|
{
|
|
for (int l = 0; l < 2; l++)
|
|
{
|
|
if (this.animator[k, l] != null)
|
|
{
|
|
this.animator[k, l].SetTrigger("Out");
|
|
}
|
|
}
|
|
}
|
|
this._counter = 0;
|
|
this.state = FadeProcess.FadeState.FadeIn;
|
|
return;
|
|
}
|
|
this._counter++;
|
|
return;
|
|
case FadeProcess.FadeState.FadeIn:
|
|
if (currentAnimatorStateInfo.normalizedTime >= 1f)
|
|
{
|
|
this.ProcessingProcess();
|
|
this.container.processManager.ReleaseProcess(this);
|
|
this.isFadeing = false;
|
|
}
|
|
break;
|
|
default:
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
|
|
// Token: 0x06000C04 RID: 3076 RVA: 0x00037E05 File Offset: 0x00037005
|
|
public virtual void StartFadeIn()
|
|
{
|
|
this.state = FadeProcess.FadeState.DoFadeIn;
|
|
this.isFadeing = true;
|
|
this._counter = 0;
|
|
}
|
|
|
|
// Token: 0x06000C05 RID: 3077 RVA: 0x00037E1C File Offset: 0x0003701C
|
|
public override void OnRelease()
|
|
{
|
|
for (int i = 0; i < 2; i++)
|
|
{
|
|
if (this.fadeObject[i] != null)
|
|
{
|
|
Object.Destroy(this.fadeObject[i]);
|
|
}
|
|
}
|
|
}
|
|
|
|
// Token: 0x04000947 RID: 2375
|
|
private int _counter;
|
|
|
|
// Token: 0x04000948 RID: 2376
|
|
protected GameObject[] fadeObject = new GameObject[2];
|
|
|
|
// Token: 0x04000949 RID: 2377
|
|
protected GameObject[,] canvasObject = new GameObject[2, 2];
|
|
|
|
// Token: 0x0400094A RID: 2378
|
|
protected Animator[,] animator = new Animator[2, 2];
|
|
|
|
// Token: 0x0400094B RID: 2379
|
|
protected ProcessBase fromProcess;
|
|
|
|
// Token: 0x0400094C RID: 2380
|
|
protected ProcessBase toProcess;
|
|
|
|
// Token: 0x0400094D RID: 2381
|
|
protected FadeProcess.FadeState state;
|
|
|
|
// Token: 0x0400094E RID: 2382
|
|
protected FadeProcess.FadeType fadeType = FadeProcess.FadeType.Type1;
|
|
|
|
// Token: 0x0400094F RID: 2383
|
|
protected bool isFadeing;
|
|
|
|
// Token: 0x04000950 RID: 2384
|
|
protected bool isAddProcess;
|
|
|
|
// Token: 0x04000951 RID: 2385
|
|
private int _restartPleaseWaitID = -1;
|
|
|
|
// Token: 0x04000952 RID: 2386
|
|
private bool isReleaseCustomMaterial = true;
|
|
|
|
// Token: 0x02000A07 RID: 2567
|
|
protected enum FadeState
|
|
{
|
|
// Token: 0x040062C0 RID: 25280
|
|
DoFadeOut,
|
|
// Token: 0x040062C1 RID: 25281
|
|
FadeOut,
|
|
// Token: 0x040062C2 RID: 25282
|
|
DoFadeIn,
|
|
// Token: 0x040062C3 RID: 25283
|
|
FadeIn
|
|
}
|
|
|
|
// Token: 0x02000A08 RID: 2568
|
|
protected enum CanvasTarget
|
|
{
|
|
// Token: 0x040062C5 RID: 25285
|
|
Main,
|
|
// Token: 0x040062C6 RID: 25286
|
|
Sub,
|
|
// Token: 0x040062C7 RID: 25287
|
|
End
|
|
}
|
|
|
|
// Token: 0x02000A09 RID: 2569
|
|
public enum FadeType
|
|
{
|
|
// Token: 0x040062C9 RID: 25289
|
|
Type1 = 1,
|
|
// Token: 0x040062CA RID: 25290
|
|
Type2,
|
|
// Token: 0x040062CB RID: 25291
|
|
Type3
|
|
}
|
|
}
|