Created
February 26, 2020 09:05
-
-
Save Frank-Buss/678ee83938f25b0dde0980f922fca127 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class NewBehaviourScript : MonoBehaviour | |
{ | |
private static System.Type[] types = { | |
typeof(Integer), | |
typeof(Long), | |
typeof(String)}; | |
public void test(int ID) | |
{ | |
System.Type type = default; | |
if (ID >= 0 && ID < types.length) { | |
type = types[ID]; | |
} | |
// do something with type | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment