コード例 #1
0
    //---------------------------------------------------------------------------------------------------------
    void DrawAnimationData(SerializedProperty _eventAnim, ref bool _toBeRemoved, int _idx)
    {
        var    type     = (EventAnimationType)_eventAnim.FindPropertyRelative("m_type").enumValueIndex;
        string typeName = type.ToString();

        bool play = false;
        bool show = m_eventAnimVisibilities [_idx];

        DrawAnimationButtonBar(_eventAnim, typeName, _idx, ref show, ref play, ref _toBeRemoved);
        m_eventAnimVisibilities [_idx] = show;

        EditorGUI.indentLevel++;
        if (show)
        {
            SerializedProperty anims;
            for (int i = 0; i < AnimationData.s_eventAnimMembers.Count; i++)
            {
                anims = _eventAnim.FindPropertyRelative(AnimationData.s_eventAnimMembers [i]);
                if (anims.arraySize <= 0)
                {
                    continue;
                }
                var options = EditorListOption.ListLabel | EditorListOption.ElementLabels | EditorListOption.AllButtons;
                EditorList.Display(anims, options);
            }
        }
        EditorGUI.indentLevel--;

        if (play)
        {
            PlayAnimation(type);
        }
    }