示例#1
0
        /// <summary>
        /// OnGUI is called for rendering and handling GUI events.
        /// This function can be called multiple times per frame (one call per event).
        /// </summary>
        void OnGUI()
        {
            if (table == null)
            {
                BuildTable();
            }
            var pos = position;

            pos.x       = 0f;
            pos.y       = 0f;
            pos.height -= 16f;

            _roots = _roots ?? new GameObject[0];

            table.Draw(pos, GetAllChildren <Hitbox>().Concat(GetAllChildren <Hurtbox>()));

            pos.y      = pos.y + pos.height;
            pos.height = 16f;
            pos.width -= 200;

            hurtboxType = (HurtboxType)EditorGUI.EnumPopup(pos, hurtboxType);

            pos.x    += pos.width;
            pos.width = 200;

            if (GUI.Button(pos, "Set Hurtbox Type"))
            {
                SetAllHurtboxTypes(hurtboxType);
            }

            // Force Repaint the animation view if something changed.
            if (GUI.changed)
            {
                InternalEditorUtility.RepaintAllViews();
            }
        }