Unity 图片自动识别尺寸

 StartCoroutine(LoadUnitDatas());
 public IEnumerator LoadUnitDatas() {
        yield return new WaitForEndOfFrame();
        myScorllRect.gameObject.SetActive(true);
        myScorllRect.content.GetComponent<Image>().sprite = scrollSpriet;
        myScorllRect.content.GetComponent<Image>().SetNativeSize();
    }

 

posted on 2021-04-20 17:19  zqiang0803  阅读(210)  评论(0编辑  收藏  举报

导航