2021-04-04 03:41:36 +10:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
2021-04-15 20:18:03 +10:00
|
|
|
|
namespace UnityExplorer.Tests
|
2021-04-04 03:41:36 +10:00
|
|
|
|
{
|
|
|
|
|
public static class TestClass
|
|
|
|
|
{
|
2021-05-01 20:55:27 +10:00
|
|
|
|
public static List<object> List
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
var list = new List<object>();
|
|
|
|
|
int count = UnityEngine.Random.Range(0, 100);
|
|
|
|
|
for (int i = 0; i < count; i++)
|
|
|
|
|
list.Add(GetRandomObject());
|
|
|
|
|
return list;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private static object GetRandomObject()
|
|
|
|
|
{
|
|
|
|
|
object ret = null;
|
|
|
|
|
|
|
|
|
|
int ran = UnityEngine.Random.Range(0, 7);
|
|
|
|
|
switch (ran)
|
|
|
|
|
{
|
|
|
|
|
case 0: return null;
|
|
|
|
|
case 1: return 123;
|
|
|
|
|
case 2: return true;
|
|
|
|
|
case 3: return "hello";
|
|
|
|
|
case 4: return 50.5f;
|
|
|
|
|
case 5: return UnityEngine.CameraClearFlags.Color;
|
|
|
|
|
case 6: return new List<string> { "sub list", "lol" };
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
|
}
|
2021-04-06 01:01:46 +10:00
|
|
|
|
|
2021-04-28 20:47:48 +10:00
|
|
|
|
public const int ConstantInt = 5;
|
|
|
|
|
|
2021-04-28 23:58:13 +10:00
|
|
|
|
public static byte[] ByteArray = new byte[16];
|
2021-05-01 20:55:27 +10:00
|
|
|
|
public static string LongString = new string('#', 10000);
|
2021-04-28 20:47:48 +10:00
|
|
|
|
|
2021-04-04 13:44:58 +10:00
|
|
|
|
#if CPP
|
|
|
|
|
public static string testStringOne = "Test";
|
|
|
|
|
public static Il2CppSystem.Object testStringTwo = "string boxed as cpp object";
|
|
|
|
|
public static Il2CppSystem.String testStringThree = "string boxed as cpp string";
|
|
|
|
|
public static string nullString = null;
|
|
|
|
|
|
2021-04-04 03:41:36 +10:00
|
|
|
|
public static Il2CppSystem.Collections.Hashtable testHashset;
|
2021-04-07 17:20:09 +10:00
|
|
|
|
public static Il2CppSystem.Collections.Generic.List<Il2CppSystem.Object> testList;
|
2021-04-28 20:47:48 +10:00
|
|
|
|
#endif
|
2021-04-04 03:41:36 +10:00
|
|
|
|
|
|
|
|
|
static TestClass()
|
|
|
|
|
{
|
2021-04-28 20:47:48 +10:00
|
|
|
|
#if CPP
|
2021-04-04 03:41:36 +10:00
|
|
|
|
testHashset = new Il2CppSystem.Collections.Hashtable();
|
|
|
|
|
testHashset.Add("key1", "itemOne");
|
|
|
|
|
testHashset.Add("key2", "itemTwo");
|
|
|
|
|
testHashset.Add("key3", "itemThree");
|
2021-04-07 17:20:09 +10:00
|
|
|
|
|
|
|
|
|
testList = new Il2CppSystem.Collections.Generic.List<Il2CppSystem.Object>(3);
|
|
|
|
|
testList.Add("One");
|
|
|
|
|
testList.Add("Two");
|
|
|
|
|
testList.Add("Three");
|
2021-04-04 03:41:36 +10:00
|
|
|
|
#endif
|
2021-04-28 20:47:48 +10:00
|
|
|
|
}
|
2021-04-04 13:44:58 +10:00
|
|
|
|
}
|
2021-04-04 03:41:36 +10:00
|
|
|
|
}
|