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.

Revisions

  1. yoshapihoff created this gist Oct 6, 2016.
    19 changes: 19 additions & 0 deletions CacheComponent.cs
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,19 @@
    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);
    }
    }