Beispiel #1
0
    public Texture2D GetImage()
    {
        SpriteAnimation ani = SpriteAnimations.Get(name + pose);

        if (ani != null)
        {
            return(ani.GetImage());
        }
        if (table.ContainsKey(pose))
        {
            return(table[pose]);
        }
        return(null);
    }
Beispiel #2
0
    void OnGUI()
    {
        if (ani == null || ani.name == "")
        {
            ani = SpriteAnimations.Get(skin);
            if (ani == null)
            {
                return;
            }
        }

        GUI.depth = depth;
        Rect brush = area;

        if (lockWidthToHeight)
        {
            brush = area.MiddleCenter(area.height / area.width, 1);
        }

        GUI.DrawTexture(brush, ani.GetImageNormalized(val));
    }
Beispiel #3
0
 void Start()
 {
     ani = SpriteAnimations.Get(skin);
 }