mirror of
https://github.com/GrahamKracker/UnityExplorer.git
synced 2025-07-04 04:22:53 +08:00
Add support for generic methods, improved non-generic dictionary output
This commit is contained in:
@ -5,6 +5,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using MelonLoader;
|
||||
using Mono.CSharp.Linq;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Explorer.Tests
|
||||
@ -26,6 +27,18 @@ namespace Explorer.Tests
|
||||
public static int StaticField = 5;
|
||||
public int NonStaticField;
|
||||
|
||||
// test a generic method
|
||||
public static string TestGeneric<C, T>(string arg0) where C : Component
|
||||
{
|
||||
return "C: " + typeof(C).FullName + ", T: " + typeof(T).FullName + ", arg0: " + arg0;
|
||||
}
|
||||
|
||||
//// this type of generic is not supported, due to requiring a non-primitive argument.
|
||||
//public static T TestDifferentGeneric<T>(T obj) where T : Component
|
||||
//{
|
||||
// return obj;
|
||||
//}
|
||||
|
||||
// test a non-generic dictionary
|
||||
|
||||
public Hashtable TestNonGenericDict()
|
||||
|
Reference in New Issue
Block a user