UI2DSprite roleSprite=GetComponent<UI2DSprite >("roleSprite"); var roleSprites = Resources.LoadAll<Sprite>("sprite的路径"); roleSprite.sprite2D = roleSprites[1];//1是某一帧的索引
动态修改NGUI UI2DSprite
时间: 2024-10-12 16:19:26
UI2DSprite roleSprite=GetComponent<UI2DSprite >("roleSprite"); var roleSprites = Resources.LoadAll<Sprite>("sprite的路径"); roleSprite.sprite2D = roleSprites[1];//1是某一帧的索引
动态修改NGUI UI2DSprite