196 lines
6.3 KiB
C#
196 lines
6.3 KiB
C#
using System;
|
|
using Cpp2IlInjected;
|
|
using UnityEngine;
|
|
using UnityEngine.EventSystems;
|
|
|
|
namespace Obi.CrossPlatformInput
|
|
{
|
|
// Token: 0x02000502 RID: 1282
|
|
[Token(Token = "0x2000502")]
|
|
public class Joystick : MonoBehaviour, IPointerDownHandler, IEventSystemHandler, IPointerUpHandler, IDragHandler
|
|
{
|
|
// Token: 0x06002CBD RID: 11453 RVA: 0x0006095C File Offset: 0x0005EB5C
|
|
[Token(Token = "0x6002CBD")]
|
|
[Address(RVA = "0x10BE1A0", Offset = "0x10BC9A0", VA = "0x1810BE1A0")]
|
|
private void OnEnable()
|
|
{
|
|
bool flag;
|
|
do
|
|
{
|
|
Joystick.AxisOption axisOption = this.axesToUse;
|
|
if (axisOption == Joystick.AxisOption.Both)
|
|
{
|
|
this.m_UseX = true;
|
|
}
|
|
flag = axisOption == Joystick.AxisOption.OnlyHorizontal;
|
|
this.m_UseX = flag;
|
|
bool flag2 = axisOption == Joystick.AxisOption.OnlyVertical;
|
|
this.m_UseY = flag2;
|
|
}
|
|
while (!flag);
|
|
CrossPlatformInputManager.VirtualAxis virtualAxis = new CrossPlatformInputManager.VirtualAxis(this.horizontalAxisName);
|
|
this.m_HorizontalVirtualAxis = virtualAxis;
|
|
CrossPlatformInputManager.RegisterVirtualAxis(this.m_HorizontalVirtualAxis);
|
|
if (this.m_UseY)
|
|
{
|
|
CrossPlatformInputManager.VirtualAxis virtualAxis2 = new CrossPlatformInputManager.VirtualAxis(this.verticalAxisName);
|
|
this.m_VerticalVirtualAxis = virtualAxis2;
|
|
CrossPlatformInputManager.RegisterVirtualAxis(this.m_VerticalVirtualAxis);
|
|
}
|
|
}
|
|
|
|
// Token: 0x06002CBE RID: 11454 RVA: 0x000020D3 File Offset: 0x000002D3
|
|
[Token(Token = "0x6002CBE")]
|
|
[Address(RVA = "0x10BE590", Offset = "0x10BCD90", VA = "0x1810BE590")]
|
|
private void Start()
|
|
{
|
|
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
|
|
}
|
|
|
|
// Token: 0x06002CBF RID: 11455 RVA: 0x000020D3 File Offset: 0x000002D3
|
|
[Token(Token = "0x6002CBF")]
|
|
[Address(RVA = "0x10BE5D0", Offset = "0x10BCDD0", VA = "0x1810BE5D0")]
|
|
private void UpdateVirtualAxes(Vector3 value)
|
|
{
|
|
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
|
|
}
|
|
|
|
// Token: 0x06002CC0 RID: 11456 RVA: 0x000609E0 File Offset: 0x0005EBE0
|
|
[Token(Token = "0x6002CC0")]
|
|
[Address(RVA = "0x10BE1A0", Offset = "0x10BC9A0", VA = "0x1810BE1A0")]
|
|
private void CreateVirtualAxes()
|
|
{
|
|
bool flag;
|
|
do
|
|
{
|
|
Joystick.AxisOption axisOption = this.axesToUse;
|
|
if (axisOption == Joystick.AxisOption.Both)
|
|
{
|
|
this.m_UseX = true;
|
|
}
|
|
flag = axisOption == Joystick.AxisOption.OnlyHorizontal;
|
|
this.m_UseX = flag;
|
|
bool flag2 = axisOption == Joystick.AxisOption.OnlyVertical;
|
|
this.m_UseY = flag2;
|
|
}
|
|
while (!flag);
|
|
CrossPlatformInputManager.VirtualAxis virtualAxis = new CrossPlatformInputManager.VirtualAxis(this.horizontalAxisName);
|
|
this.m_HorizontalVirtualAxis = virtualAxis;
|
|
CrossPlatformInputManager.RegisterVirtualAxis(this.m_HorizontalVirtualAxis);
|
|
if (this.m_UseY)
|
|
{
|
|
CrossPlatformInputManager.VirtualAxis virtualAxis2 = new CrossPlatformInputManager.VirtualAxis(this.verticalAxisName);
|
|
this.m_VerticalVirtualAxis = virtualAxis2;
|
|
CrossPlatformInputManager.RegisterVirtualAxis(this.m_VerticalVirtualAxis);
|
|
}
|
|
}
|
|
|
|
// Token: 0x06002CC1 RID: 11457 RVA: 0x000020D3 File Offset: 0x000002D3
|
|
[Token(Token = "0x6002CC1")]
|
|
[Address(RVA = "0x10BE330", Offset = "0x10BCB30", VA = "0x1810BE330", Slot = "6")]
|
|
public void OnDrag(PointerEventData data)
|
|
{
|
|
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
|
|
}
|
|
|
|
// Token: 0x06002CC2 RID: 11458 RVA: 0x000020D3 File Offset: 0x000002D3
|
|
[Token(Token = "0x6002CC2")]
|
|
[Address(RVA = "0x10BE4E0", Offset = "0x10BCCE0", VA = "0x1810BE4E0", Slot = "5")]
|
|
public void OnPointerUp(PointerEventData data)
|
|
{
|
|
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
|
|
}
|
|
|
|
// Token: 0x06002CC3 RID: 11459 RVA: 0x000020D3 File Offset: 0x000002D3
|
|
[Token(Token = "0x6002CC3")]
|
|
[Address(RVA = "0x29E8B0", Offset = "0x29D0B0", VA = "0x18029E8B0", Slot = "4")]
|
|
public void OnPointerDown(PointerEventData data)
|
|
{
|
|
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
|
|
}
|
|
|
|
// Token: 0x06002CC4 RID: 11460 RVA: 0x00060A64 File Offset: 0x0005EC64
|
|
[Token(Token = "0x6002CC4")]
|
|
[Address(RVA = "0x10BE2E0", Offset = "0x10BCAE0", VA = "0x1810BE2E0")]
|
|
private void OnDisable()
|
|
{
|
|
if (this.m_UseX)
|
|
{
|
|
this.m_HorizontalVirtualAxis.Remove();
|
|
}
|
|
if (this.m_UseY)
|
|
{
|
|
this.m_VerticalVirtualAxis.Remove();
|
|
return;
|
|
}
|
|
}
|
|
|
|
// Token: 0x06002CC5 RID: 11461 RVA: 0x00060AA0 File Offset: 0x0005ECA0
|
|
[Token(Token = "0x6002CC5")]
|
|
[Address(RVA = "0x10BE650", Offset = "0x10BCE50", VA = "0x1810BE650")]
|
|
public Joystick()
|
|
{
|
|
}
|
|
|
|
// Token: 0x0400350B RID: 13579
|
|
[FieldOffset(Offset = "0x18")]
|
|
[Token(Token = "0x400350B")]
|
|
public int MovementRange = (int)((ulong)100L);
|
|
|
|
// Token: 0x0400350C RID: 13580
|
|
[FieldOffset(Offset = "0x1C")]
|
|
[Token(Token = "0x400350C")]
|
|
public Joystick.AxisOption axesToUse;
|
|
|
|
// Token: 0x0400350D RID: 13581
|
|
[FieldOffset(Offset = "0x20")]
|
|
[Token(Token = "0x400350D")]
|
|
public string horizontalAxisName = "Horizontal";
|
|
|
|
// Token: 0x0400350E RID: 13582
|
|
[FieldOffset(Offset = "0x28")]
|
|
[Token(Token = "0x400350E")]
|
|
public string verticalAxisName = "Vertical";
|
|
|
|
// Token: 0x0400350F RID: 13583
|
|
[FieldOffset(Offset = "0x30")]
|
|
[Token(Token = "0x400350F")]
|
|
private Vector3 m_StartPos;
|
|
|
|
// Token: 0x04003510 RID: 13584
|
|
[FieldOffset(Offset = "0x3C")]
|
|
[Token(Token = "0x4003510")]
|
|
private bool m_UseX;
|
|
|
|
// Token: 0x04003511 RID: 13585
|
|
[FieldOffset(Offset = "0x3D")]
|
|
[Token(Token = "0x4003511")]
|
|
private bool m_UseY;
|
|
|
|
// Token: 0x04003512 RID: 13586
|
|
[FieldOffset(Offset = "0x40")]
|
|
[Token(Token = "0x4003512")]
|
|
private CrossPlatformInputManager.VirtualAxis m_HorizontalVirtualAxis;
|
|
|
|
// Token: 0x04003513 RID: 13587
|
|
[FieldOffset(Offset = "0x48")]
|
|
[Token(Token = "0x4003513")]
|
|
private CrossPlatformInputManager.VirtualAxis m_VerticalVirtualAxis;
|
|
|
|
// Token: 0x02000503 RID: 1283
|
|
[Token(Token = "0x2000503")]
|
|
public enum AxisOption
|
|
{
|
|
// Token: 0x04003515 RID: 13589
|
|
[Token(Token = "0x4003515")]
|
|
Both,
|
|
// Token: 0x04003516 RID: 13590
|
|
[Token(Token = "0x4003516")]
|
|
OnlyHorizontal,
|
|
// Token: 0x04003517 RID: 13591
|
|
[Token(Token = "0x4003517")]
|
|
OnlyVertical
|
|
}
|
|
}
|
|
}
|