using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class TestSprite : MonoBehaviour
{
public SpriteRenderer spriteRenderer;
public Texture2D tex;
public Vector2 siz = Vector2.zero;
// Start is called before the first frame update
void Start()
{
init2DSprite();
}
private void init2DSprite()
{
spriteRenderer = this.GetComponent<SpriteRenderer>();
tex = spriteRenderer.sprite.texture;
spriteRenderer.drawMode = SpriteDrawMode.Tiled;
this.transform.localScale = Vector3.one;
spriteRenderer.size = new Vector2(tex.width, tex.height)*0.01f;
siz = spriteRenderer.size;
}//
}//