Ejemplo n.º 1
0
 public AtlasReference GetAtlasReference()
 {
     if (m_AtlasRef == null)
     {
         m_AtlasRef = gameObject.GetComponentInParent <AtlasReference>();
     }
     return(m_AtlasRef);
 }
Ejemplo n.º 2
0
    public static void SetImage(SDImage image, AtlasData ad, Sprite sprite)
    {
        image.sprite = sprite;
        //image.SpriteName = sprite.name;
        if (ad.material != null || !(image.material != null && string.Equals(image.material.shader.name, "UI/Default(grey)")))
        {
            image.material = ad.material;
        }
        else
        {
            image.material = null;
        }

        AtlasReference reference = image.GetAtlasReference();

        if (reference != null)
        {
            reference.AddRef(image, ad);
        }
    }