Skip to content

Instantly share code, notes, and snippets.

@Frank-Buss
Created February 26, 2020 08:59
Show Gist options
  • Save Frank-Buss/821bf30960f5f8456859150791d9bdba to your computer and use it in GitHub Desktop.
Save Frank-Buss/821bf30960f5f8456859150791d9bdba to your computer and use it in GitHub Desktop.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class NewBehaviourScript : MonoBehaviour
{
public void test(int ID)
{
System.Type types = {
typeof(Integer),
typeof(Long),
typeof(String)};
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