Yes. Thanks.
But if the 2DSprite also can use the way to be changed as UISprite ? By using something like Atlas for sprite to change 2D Sprite ?
My Idea is In 2DUISprite has one member, this member is one list of Unity 2DSprite, just like Atlas for UISprite. By change the name to change the 2DUISprite.
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class Change2DSprite : MonoBehaviour
{
public List<Sprite> SpriteListAtlas = new List<Sprite>();
public UI2DSprite mySprite;
void Change2DSprite(string newSpriteName)
{
for (int i = 0; i < SpriteListAtlas.Count; i++)
{
if (SpriteListAtlas.name == newSpriteName)
{
mySprite.sprite2D = SpriteListAtlas;
}
}
}
}