Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Renderer r;
- void Awake()
- {
- r = transform.GetComponent<Renderer>();
- SetTextureTiles(transform.localScale.x, transform.localScale.y);
- }
- void SetTextureTiles(float x, float y)
- {
- float width = x / 0.5F;
- float height = y / 0.5F;
- r.material.mainTextureScale = new Vector2(width, height);
- }
Advertisement
Add Comment
Please, Sign In to add comment