Esempio n. 1
0
        public static void Play(this Image img, Sprite[] sprites, float inter = 16, bool loop = false, Action <ImageAnimat> over = null, bool hide = true, bool cover = true)
        {
            if (img == null)
            {
                return;
            }
            img.gameObject.SetActive(true);
            var ani = AnimationManage.Manage.FindAni <ImageAnimat>((o) => { return(o.image == img ? true : false); });

            if (ani == null)
            {
                ani = new ImageAnimat(img);
            }
            else if (!cover)
            {
                return;
            }
            ani.autoHide = hide;
            if (over == null)
            {
                ani.PlayOver = (o) => { o.Dispose(); }
            }
            ;
            else
            {
                ani.PlayOver = over;
            }
            ani.Loop     = loop;
            ani.Interval = inter;
            ani.Play(sprites);
        }
Esempio n. 2
0
        public static ImageAnimat FindOrCreateSpritesAni(this Image img)
        {
            if (img == null)
            {
                return(null);
            }
            img.gameObject.SetActive(true);
            var ani = AnimationManage.Manage.FindAni <ImageAnimat>((o) => { return(o.image == img ? true : false); });

            if (ani == null)
            {
                ani = new ImageAnimat(img);
            }
            return(ani);
        }