Skip to content

Instantly share code, notes, and snippets.

@yoshapihoff
Created October 6, 2016 05:49
Show Gist options
  • Save yoshapihoff/f3bcc701c6942a5f6669cf17a78a3b95 to your computer and use it in GitHub Desktop.
Save yoshapihoff/f3bcc701c6942a5f6669cf17a78a3b95 to your computer and use it in GitHub Desktop.
public class CacheComponent: MonoBehaviour
{
Transform thisTransform;
public new Transform transform
{
get
{
if (thisTransform == null)
{
thisTransform = base.transform;
}
return thisTransform;
}
}
void Update()
{
transform.Translate(0, 0, 5);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment