Example #1
0
        bool ArgumentInfoField(int index, AssetPostAddress.ArgumentInfo info)
        {
            bool deleteFlag = false;

            var numW = GUILayout.Width(32);

            var indent = EditorGUI.indentLevel;

            EditorGUI.indentLevel = 0;
            EditorGUILayout.BeginHorizontal();
            GUILayout.FlexibleSpace();
            EditorGUILayout.LabelField("{" + index + "}", GUILayout.Width(24));

            var labelWidth = EditorGUIUtility.labelWidth;

            EditorGUIUtility.labelWidth = 40;
            info.elementIndex           = EditorGUILayout.IntField(kIndexContent, info.elementIndex, GUILayout.Width(65));
            EditorGUIUtility.labelWidth = labelWidth;

            GUILayout.Space(8);
            info.startIndex = EditorGUILayout.IntField(info.startIndex, numW);
            EditorGUILayout.LabelField("文字目 -", GUILayout.Width(45));
            info.endIndex = EditorGUILayout.IntField(info.endIndex, numW);
            EditorGUILayout.LabelField("文字目", GUILayout.Width(45));

            if (GUILayout.Button(GUIContent.none, m_deleteBtnStyle, GUILayout.Width(16)))
            {
                deleteFlag = true;
            }

            EditorGUILayout.EndHorizontal();
            EditorGUI.indentLevel = indent;

            return(deleteFlag);
        }
Example #2
0
        void EditAddress(AssetPostAddress address)
        {
            address.name            = EditorGUILayout.TextField("登録名", address.name ?? string.Empty);
            address.fileNamePattern = EditorGUILayout.TextField(kPatternContent, address.fileNamePattern);

            EditorGUILayout.Space();

            EditorGUILayout.LabelField("お届け先", m_labelStyle);
            EditorGUI.BeginChangeCheck();
            var labelWidth = EditorGUIUtility.labelWidth;

            EditorGUIUtility.labelWidth = 45;
            address.assetPathFormat     = EditorGUILayout.TextField(kAssetPathContent, address.assetPathFormat);
            EditorGUIUtility.labelWidth = labelWidth;
            if (EditorGUI.EndChangeCheck())
            {
                m_needArgmentCount = GetFormatArgumentCount(address.assetPathFormat);
            }

            ++EditorGUI.indentLevel;
            EditorGUILayout.LabelField("format引数設定 - ファイル名をSplitして使う");

            address.separators = SeparatorsField(address.separators, address.fileNamePattern);

            for (int i = 0; i < address.argumentList.Count; ++i)
            {
                if (ArgumentInfoField(i, address.argumentList[i]))
                {
                    address.argumentList.RemoveAt(i--);
                }
            }

            EditorGUILayout.BeginHorizontal();
            GUILayout.FlexibleSpace();
            if (GUILayout.Button("引数追加", m_plusStyle))
            {
                var info = new AssetPostAddress.ArgumentInfo();
                address.argumentList.Add(info);
            }
            EditorGUILayout.EndHorizontal();

            if (address.argumentList.Count < m_needArgmentCount)
            {
                EditorGUILayout.HelpBox("引数の数がたりません", MessageType.Warning);
            }

            --EditorGUI.indentLevel;
        }