コード例 #1
0
        private void OnDrawElement(Rect rect, int index, bool isActive, bool isFocused)
        {
            var element = list.serializedProperty.GetArrayElementAtIndex(index);

            var fields = new [] { "Key", "key", "Clip", "clip", "Global", "global" };

            EditorGuiHelper.ListElementPropertyFields(element, fields, rect);
        }
コード例 #2
0
        public override void OnInspectorGUI()
        {
            serializedObject.Update();

            EditorGuiHelper.AutoPropertyFields(
                serializedObject,
                new [] { new KeyValuePair <string, Action>(SourceConfigsFieldName, () => flagsList.DoLayoutList()) });

            if (GUI.changed)
            {
                serializedObject.ApplyModifiedProperties();
            }
        }
コード例 #3
0
    ExperimentDesignFile2 CreateDesignFile()
    {
        string oldPath             = AssetDatabase.GetAssetPath(target);
        ExperimentDesignFile2 file = CreateInstance <ExperimentDesignFile2>();
        string fileName            = Path.GetFileNameWithoutExtension(oldPath) + "_updated" + ".asset";
        string path       = Path.GetDirectoryName(oldPath);
        string fullPath   = Path.Combine(path, fileName);
        string uniquePath = EditorGuiHelper.GetUniqueName(fullPath);

        Debug.Log(uniquePath);
        AssetDatabase.CreateAsset(file, uniquePath);
        AssetDatabase.SaveAssets();
        return(file);
    }
コード例 #4
0
        public override void OnInspectorGUI()
        {
            this.SetupPopup();

            var mover = (Mover)this.target;

            EditorGuiHelper.AutoPropertyFields(
                this.serializedObject,
                new KeyValuePair <string, Action>("moveDriverName", () => MoveDriverField(mover)));

            var moverSpeed = mover.Driver == null ? 0f : mover.Driver.Speed;

            EditorGUILayout.LabelField("Speed", moverSpeed.ToString());

            this.serializedObject.ApplyModifiedProperties();

            if (GUI.changed)
            {
                EditorUtility.SetDirty(this.target);
            }
        }
コード例 #5
0
        private void OnDrawElement(Rect rect, int index, bool isActive, bool isFocused)
        {
            var element       = list.serializedProperty.GetArrayElementAtIndex(index);
            var valueInstance = namedConstants.values[index];

            var valueField = string.Empty;

            switch (valueInstance.Type)
            {
            case NamedConstants.ConstType.Int:
                valueField = "intValue";
                break;

            case NamedConstants.ConstType.String:
                valueField = "stringValue";
                break;

            case NamedConstants.ConstType.Float:
                valueField = "floatValue";
                break;
            }

            EditorGuiHelper.ListElementPropertyFields(element, new [] { "Name", "name", "Group", "group", "", "type", "", valueField }, rect);
        }