Пример #1
0
        public virtual void DrawGUISetting(Rect rect, float singleLineHeight, float padding)
        {
            rect.height -= 2 * padding;
            rect.y      += padding;
            //只能使用Rect,否则用AreaScope会出错
            using (new EditorGUILabelWidthScope(40))
            {
                prefab = EditorGUIUtil.ObjectField <GameObject>(
                    new Rect(rect.x, rect.y, rect.width, singleLineHeight),
                    "prefab", prefab, false);
            }

            localPosition = EditorGUI.Vector3Field(
                new Rect(rect.x, rect.y + 1 * singleLineHeight, rect.width, singleLineHeight),
                "localPosition", localPosition);
            localEulerAngles = EditorGUI.Vector3Field(
                new Rect(rect.x, rect.y + 3 * singleLineHeight, rect.width, singleLineHeight),
                "localEulerAngles", localEulerAngles);
            localScale = EditorGUI.Vector3Field(
                new Rect(rect.x, rect.y + 5 * singleLineHeight, rect.width, singleLineHeight),
                "localScale", localScale);
        }
Пример #2
0
        public override void DrawGUISetting_Detail()
        {
            base.DrawGUISetting_Detail();

            //draw skinnedMeshRenderer_list
            skinnedMeshRendererReorderableListInfo.SetElementHeight(EditorConst.Single_Line_Height + 2 * ReorderableListConst.Padding);
            skinnedMeshRendererReorderableListInfo.reorderableList.drawElementCallback =
                (rect, index, isActive, isFocused) =>
            {
                rect.height -= 2 * ReorderableListConst.Padding;
                rect.y      += ReorderableListConst.Padding;
                //只能使用Rect,否则用AreaScope会出错
                using (new EditorGUILabelWidthScope(130))
                {
                    skinnedMeshRendererReorderableListInfo.reorderableList.list[index] = EditorGUIUtil.ObjectField <SkinnedMeshRenderer>(
                        new Rect(rect.x, rect.y, rect.width, EditorConst.Single_Line_Height),
                        "skinnedMeshRenderer", skinnedMeshRendererReorderableListInfo.reorderableList.list[index] as SkinnedMeshRenderer, true);
                }
            };
            skinnedMeshRendererReorderableListInfo.DrawGUI("skinnedMeshRenderer_list");
            SetSkinnedMeshRendererListOfItemInfoes();
        }