Esempio n. 1
0
        static void AfterLoad(SkeletonAnimation skeletonAnimation, SkeletonDataAsset skeletonDataAsset, string [] actions = null, bool flip = false)
        {
            skeletonAnimation.skeletonDataAsset = skeletonDataAsset;
            skeletonAnimation.Initialize(true);
            if (skeletonAnimation.state != null && actions != null)
            {
                for (int i = 0; i < actions.Length; i++)
                {
                    if (!string.IsNullOrEmpty(actions[i]))
                    {
                        if (i == 0)
                        {
                            skeletonAnimation.state.SetAnimation(0, actions[i], (i == (actions.Length - 1)));
                        }
                        else
                        {
                            skeletonAnimation.state.AddAnimation(0, actions[i], (i == (actions.Length - 1)), 0);
                        }
                    }
                }
            }
            if (skeletonAnimation.skeleton != null && flip)
            {
                skeletonAnimation.skeleton.FlipX = flip;
            }
            MaskableSkeletonAnimation msa = skeletonAnimation.gameObject.GetComponent <MaskableSkeletonAnimation>();

            if (msa != null)
            {
                msa.UpdateStencil();
            }
        }
Esempio n. 2
0
        public void SetExposure(float exposure)
        {
            if (spineObject == null)
            {
                return;
            }

            MaskableSkeletonAnimation ani = spineObject.GetComponent <MaskableSkeletonAnimation>();

            if (ani == null)
            {
                ani = spineObject.AddComponent <MaskableSkeletonAnimation>();
            }
            ani.Exposure = exposure;
        }