Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Denwery

Pages: [1]
1
NGUI 3 Support / Re: Unity sprite animation
« on: February 14, 2014, 06:29:35 AM »
I have found that this script for organizing animations with UI2DSpriteAnimation works fine too:

public class UI2DSpriteAnimation : MonoBehaviour
{
   
    private UnityEngine.SpriteRenderer mUnitySprite;
    private UI2DSprite mNguiSprite;
   
    private void Start()
    {
        mUnitySprite = GetComponent<UnityEngine.SpriteRenderer>();
        mNguiSprite = GetComponent<UI2DSprite>();
    }

    void Update()
    {
        mNguiSprite.nextSprite = mUnitySprite.sprite;
    }

(But if write "mNguiSprite.sprite2D = mUnitySprite.sprite;" visual effect of sprite changing is visible.)

Pages: [1]