Ejemplo n.º 1
0
        /// <inheritoc/>
        protected internal override void Initialize(int layoutIndex)
        {
            if (property.Type == SerializableProperty.FieldType.Vector2)
            {
                guiField              = new GUIVector2Field(new GUIContent(title));
                guiField.OnChanged   += OnFieldValueChanged;
                guiField.OnConfirmed += OnFieldValueConfirm;
                guiField.OnFocusLost += OnFieldValueConfirm;

                layout.AddElement(layoutIndex, guiField);
            }
        }
Ejemplo n.º 2
0
        /// <inheritoc/>
        protected internal override void Initialize(int layoutIndex)
        {
            if (property.Type == SerializableProperty.FieldType.Vector2)
            {
                guiField = new GUIVector2Field(new GUIContent(title));
                guiField.OnChanged += OnFieldValueChanged;
                guiField.OnConfirmed += OnFieldValueConfirm;
                guiField.OnFocusLost += OnFieldValueConfirm;

                layout.AddElement(layoutIndex, guiField);
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Creates a new material parameter GUI.
        /// </summary>
        /// <param name="shaderParam">Shader parameter to create the GUI for. Must be of 2D vector type.</param>
        /// <param name="material">Material the parameter is a part of.</param>
        /// <param name="layout">Layout to append the GUI elements to.</param>
        internal MaterialParamVec2GUI(ShaderParameter shaderParam, Material material, GUILayout layout)
            : base(shaderParam)
        {
            LocString title = new LocEdString(shaderParam.name);

            guiElem            = new GUIVector2Field(title);
            guiElem.OnChanged += (x) =>
            {
                material.SetVector2(shaderParam.name, x);
                EditorApplication.SetDirty(material);
            };

            layout.AddElement(guiElem);
        }
Ejemplo n.º 4
0
 private static extern void Internal_CreateInstance(GUIVector2Field instance, GUIContent title, int titleWidth,
                                                    string style, GUIOption[] options, bool withTitle);
Ejemplo n.º 5
0
 private static extern void Internal_CreateInstance(GUIVector2Field instance, GUIContent title, int titleWidth,
     string style, GUIOption[] options, bool withTitle);
Ejemplo n.º 6
0
        /// <summary>
        /// Creates a new material parameter GUI.
        /// </summary>
        /// <param name="shaderParam">Shader parameter to create the GUI for. Must be of 2D vector type.</param>
        /// <param name="material">Material the parameter is a part of.</param>
        /// <param name="layout">Layout to append the GUI elements to.</param>
        internal MaterialParamVec2GUI(ShaderParameter shaderParam, Material material, GUILayout layout)
            : base(shaderParam)
        {
            LocString title = new LocEdString(shaderParam.Name);
            guiElem = new GUIVector2Field(title);
            guiElem.OnChanged += (x) =>
            {
                material.SetVector2(shaderParam.Name, x);
                EditorApplication.SetDirty(material);
            };

            layout.AddElement(guiElem);
        }