112 lines
3.3 KiB
C#
112 lines
3.3 KiB
C#
using System;
|
|
using Cpp2IlInjected;
|
|
using UnityEngine;
|
|
using UnityEngine.Events;
|
|
using UnityEngine.UI;
|
|
|
|
namespace MTAssets.UltimateLODSystem
|
|
{
|
|
// Token: 0x020005F6 RID: 1526
|
|
[Token(Token = "0x20005F6")]
|
|
public class RuntimeScanDemo : MonoBehaviour
|
|
{
|
|
// Token: 0x06002FF9 RID: 12281 RVA: 0x00065B68 File Offset: 0x00063D68
|
|
[Token(Token = "0x6002FF9")]
|
|
[Address(RVA = "0x472FA0", Offset = "0x4717A0", VA = "0x180472FA0")]
|
|
private void Start()
|
|
{
|
|
UnityEvent onDoneScan = this.ulodOfScene.onDoneScan;
|
|
UnityAction unityAction = delegate
|
|
{
|
|
this.scanStatus.text = "Scan Done! Showing LOD Demo";
|
|
this.cameraAnimator.SetBool("runLoop", true);
|
|
this.buttonObj.SetActive(true);
|
|
};
|
|
onDoneScan.AddListener(unityAction);
|
|
UnityEvent onUndoScan = this.ulodOfScene.onUndoScan;
|
|
UnityAction unityAction2 = delegate
|
|
{
|
|
this.scanStatus.text = "No Scan Performed Yet";
|
|
Animator animator = this.cameraAnimator;
|
|
int num = 0;
|
|
animator.SetBool("runLoop", num != 0);
|
|
this.buttonObj.SetActive(true);
|
|
};
|
|
onUndoScan.AddListener(unityAction2);
|
|
}
|
|
|
|
// Token: 0x06002FFA RID: 12282 RVA: 0x00065BBC File Offset: 0x00063DBC
|
|
[Token(Token = "0x6002FFA")]
|
|
[Address(RVA = "0x4731B0", Offset = "0x4719B0", VA = "0x1804731B0")]
|
|
private void Update()
|
|
{
|
|
if (this.ulodOfScene.isMeshesCurrentScannedAndLodsWorkingInThisComponent())
|
|
{
|
|
this.buttonText.text = "Undo Current Scan And Delete Generated LODs";
|
|
}
|
|
if (!this.ulodOfScene.isMeshesCurrentScannedAndLodsWorkingInThisComponent())
|
|
{
|
|
bool flag = ((ICanvasElement)this.buttonText).IsDestroyed();
|
|
return;
|
|
}
|
|
}
|
|
|
|
// Token: 0x06002FFB RID: 12283 RVA: 0x00065C08 File Offset: 0x00063E08
|
|
[Token(Token = "0x6002FFB")]
|
|
[Address(RVA = "0x472E90", Offset = "0x471690", VA = "0x180472E90")]
|
|
public void StartUndoScan()
|
|
{
|
|
if (this.ulodOfScene.isMeshesCurrentScannedAndLodsWorkingInThisComponent())
|
|
{
|
|
this.scanStatus.text = "Undoing Scan...";
|
|
GameObject gameObject = this.buttonObj;
|
|
int num = 0;
|
|
gameObject.SetActive(num != 0);
|
|
this.ulodOfScene.UndoCurrentScanWorkingAndDeleteGeneratedMeshes(true, true);
|
|
return;
|
|
}
|
|
if (!this.ulodOfScene.isMeshesCurrentScannedAndLodsWorkingInThisComponent())
|
|
{
|
|
this.scanStatus.text = "Scanning...";
|
|
GameObject gameObject2 = this.buttonObj;
|
|
int num2 = 0;
|
|
gameObject2.SetActive(num2 != 0);
|
|
this.ulodOfScene.ScanAllMeshesAndGenerateLodsGroups();
|
|
return;
|
|
}
|
|
}
|
|
|
|
// Token: 0x06002FFC RID: 12284 RVA: 0x00065C94 File Offset: 0x00063E94
|
|
[Token(Token = "0x6002FFC")]
|
|
[Address(RVA = "0x33E460", Offset = "0x33CC60", VA = "0x18033E460")]
|
|
public RuntimeScanDemo()
|
|
{
|
|
}
|
|
|
|
// Token: 0x04003A4D RID: 14925
|
|
[FieldOffset(Offset = "0x18")]
|
|
[Token(Token = "0x4003A4D")]
|
|
public UltimateLevelOfDetail ulodOfScene;
|
|
|
|
// Token: 0x04003A4E RID: 14926
|
|
[FieldOffset(Offset = "0x20")]
|
|
[Token(Token = "0x4003A4E")]
|
|
public Text buttonText;
|
|
|
|
// Token: 0x04003A4F RID: 14927
|
|
[FieldOffset(Offset = "0x28")]
|
|
[Token(Token = "0x4003A4F")]
|
|
public GameObject buttonObj;
|
|
|
|
// Token: 0x04003A50 RID: 14928
|
|
[FieldOffset(Offset = "0x30")]
|
|
[Token(Token = "0x4003A50")]
|
|
public Text scanStatus;
|
|
|
|
// Token: 0x04003A51 RID: 14929
|
|
[FieldOffset(Offset = "0x38")]
|
|
[Token(Token = "0x4003A51")]
|
|
public Animator cameraAnimator;
|
|
}
|
|
}
|