Created
March 7, 2010 02:05
-
-
Save rboyd/324096 to your computer and use it in GitHub Desktop.
This file contains 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 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