/// <inheritoc/> protected internal override void Initialize(int layoutIndex) { if (property.Type == SerializableProperty.FieldType.Vector4) { guiField = new GUIVector4Field(new GUIContent(title)); guiField.OnComponentChanged += OnFieldValueChanged; guiField.OnConfirm += x => { OnFieldValueConfirm(); StartUndo(x.ToString()); }; guiField.OnComponentFocusChanged += (focus, comp) => { if (focus) { StartUndo(comp.ToString()); } else { OnFieldValueConfirm(); } }; layout.AddElement(layoutIndex, guiField); } }
/// <inheritoc/> protected internal override void Initialize(int layoutIndex) { if (property.Type == SerializableProperty.FieldType.Vector4) { guiField = new GUIVector4Field(new GUIContent(title)); guiField.OnChanged += OnFieldValueChanged; guiField.OnConfirmed += OnFieldValueConfirm; guiField.OnFocusLost += OnFieldValueConfirm; layout.AddElement(layoutIndex, guiField); } }
/// <inheritoc/> protected internal override void Initialize(int layoutIndex) { if (property.Type == SerializableProperty.FieldType.Quaternion) { guiField = new GUIVector4Field(new GUIContent(title)); guiField.OnValueChanged += OnFieldValueChanged; guiField.OnConfirm += x => OnFieldValueConfirm(); guiField.OnFocusLost += OnFieldValueConfirm; guiField.OnFocusGained += RecordStateForUndoRequested; layout.AddElement(layoutIndex, guiField); } }
/// <summary> /// Creates a new material parameter GUI. /// </summary> /// <param name="shaderParam">Shader parameter to create the GUI for. Must be of 4D 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 MaterialParamVec4GUI(ShaderParameter shaderParam, Material material, GUILayout layout) : base(shaderParam) { LocString title = new LocEdString(shaderParam.name); guiElem = new GUIVector4Field(title); guiElem.OnValueChanged += (x) => { material.SetVector4(shaderParam.name, x); EditorApplication.SetDirty(material); }; layout.AddElement(guiElem); }
private static extern void Internal_create3(GUIVector4Field managedInstance, string style);
private static extern void Internal_create2(GUIVector4Field managedInstance, LocString labelText, string style);
private static extern void Internal_create0(GUIVector4Field managedInstance, ref GUIContent labelContent, string style);
private static extern void Internal_CreateInstance(GUIVector4Field instance, ref GUIContent title, int titleWidth, string style, GUIOption[] options, bool withTitle);