Пример #1
0
 public void addAnimation(UIAnimation a, Action callback)
 {
     a.sui = this;
     removeAnimationsOfType(a.GetType());
     a.init();
     if (callback != null)
     {
         a.callback = callback;
     }
     curAnimations.Add(a);
     SmartUILogic.setActive(this);
 }
    UIAnimation.AnimationSection GetFrameAnimationSection(SerializedProperty section)
    {
        UIAnimation anim = target as UIAnimation;

        System.Reflection.PropertyInfo frameListPropInfo = anim.GetType().GetProperty("_AnimationFrames");
        IList frameListI = frameListPropInfo.GetValue(anim, null) as IList;

        System.Reflection.PropertyInfo sectionProp = frameListPropInfo.PropertyType.GetGenericArguments()[0].GetProperty("_" + section.name);
        foreach (var listItem in frameListI)
        {
            if (frameListI.IndexOf(listItem) == chosenFrame)
            {
                UIAnimation.AnimationSection s = sectionProp.GetValue(listItem, null) as UIAnimation.AnimationSection;
                return(s);
            }
        }

        return(null);
    }