Esempio n. 1
0
        public AnimData(Anim.AnimationType aType)
        {
            presetName     = UIAnimatorUtil.DEFAULT_PRESET_NAME;
            presetCategory = UIAnimatorUtil.UNCATEGORIZED_CATEGORY_NAME;
            data           = new Anim(aType);
#if UNITY_EDITOR
            isExpanded = new AnimBool(false);
#endif
        }
Esempio n. 2
0
 public AnimData(Anim.AnimationType aType)
 {
     presetName     = UIAnimatorUtil.DEFAULT_PRESET_NAME;
     presetCategory = UIAnimatorUtil.DEFAULT_PRESET_CATEGORY;
     data           = new Anim(aType);
 }
Esempio n. 3
0
    private static void ProcInitAnimationEvent(string strUIElementName, string strUICategoryName, Anim.AnimationType eAnimationType, UnityAction OnAnimationsStart, UnityAction OnAnimationsFinish)
    {
        List <UIElement> listUIElement = UIManager.GetUiElements(strUIElementName, strUICategoryName);
        int iCount = listUIElement.Count;

        for (int i = 0; i < iCount; i++)
        {
            UIElement pUIElement = listUIElement[i];

            // DoozyUI UIElement 의 애니메이션 콜백은 이미 있으므로
            // RemoveAllListener 를 해주면 기존 콜백 작동이 안된다.
            // 그래서 수동으로 넣고 임의로 삭제해준다...
            if (_mapRemoveAnimationsStart.ContainsKey(strUIElementName))
            {
                UnityAction onAction = _mapRemoveAnimationsStart[strUIElementName];

                pUIElement.OnInAnimationsStart.RemoveListener(onAction);
                pUIElement.OnOutAnimationsStart.RemoveListener(onAction);
                _mapRemoveAnimationsStart.Remove(strUIElementName);
            }

            if (_mapRemoveAnimationsFinish.ContainsKey(strUIElementName))
            {
                UnityAction onAction = _mapRemoveAnimationsFinish[strUIElementName];

                pUIElement.OnInAnimationsFinish.RemoveListener(onAction);
                pUIElement.OnOutAnimationsFinish.RemoveListener(onAction);
                _mapRemoveAnimationsFinish.Remove(strUIElementName);
            }

            switch (eAnimationType)
            {
            case Anim.AnimationType.In:
                if (OnAnimationsStart != null)
                {
                    pUIElement.OnInAnimationsStart.AddListener(OnAnimationsStart);
                    _mapRemoveAnimationsStart.Add(strUIElementName, OnAnimationsStart);
                }

                if (OnAnimationsFinish != null)
                {
                    pUIElement.OnInAnimationsFinish.AddListener(OnAnimationsFinish);
                    _mapRemoveAnimationsFinish.Add(strUIElementName, OnAnimationsFinish);
                }
                break;

            case Anim.AnimationType.Out:
                if (OnAnimationsStart != null)
                {
                    pUIElement.OnOutAnimationsStart.AddListener(OnAnimationsStart);
                    _mapRemoveAnimationsStart.Add(strUIElementName, OnAnimationsStart);
                }

                if (OnAnimationsFinish != null)
                {
                    pUIElement.OnOutAnimationsFinish.AddListener(OnAnimationsFinish);
                    _mapRemoveAnimationsFinish.Add(strUIElementName, OnAnimationsFinish);
                }
                break;
            }
        }
    }