Skip to content

Instantly share code, notes, and snippets.

@rboyd
Created March 7, 2010 02:05
Show Gist options
  • Save rboyd/324096 to your computer and use it in GitHub Desktop.
Save rboyd/324096 to your computer and use it in GitHub Desktop.
using UnityEngine;
using System.Collections;
using System;
using System.IO;
public class TesterScript : MonoBehaviour {
static T GetComp<T>(GameObject go) where T : class {
return go.GetComponent(typeof(T)) as T;
}
void Start () {
Transform rs = GetComp<UnityEngine.Transform>(gameObject);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment