unity get gameobject that script is attached to code example Example: unity get gameobject script is attached to this.gameObject