Class VectorControl
Represents a vector control.
Namespace: VRLabs.SimpleShaderInspectors.Controls
Syntax
public class VectorControl : PropertyControl
Remarks
While using a PropertyControl for a vector property can work just fine, it will default to displaying all 4 float values, even if the shader property represents a float2 or float3. This is due to unity treating all of them as a Vector4 inside inspectors, resulting on having a 4 float display.
With this control you have the ability to fine tune which of the 4 floats to show.
This can also be useful if you pack different values into a single Vector4 for various reasons, cause you can just create different vector controls where each one access different parts of the Vector4, so you can manage them independently inside your editor.
Examples
Example usage:
// adds a vector control
this.AddVectorControl("ExampleVector");
// adds a vector control where only the y and w values are displayed
this.AddVectorControl("ExampleVector", false, true, false, true);
Constructors
| Name | Description |
|---|---|
| VectorControl(String, Boolean, Boolean, Boolean, Boolean) | Default constructor of VectorControl |
Properties
| Name | Description |
|---|---|
| IsWVisible | Visibility state of the w value |
| IsXVisible | Visibility state of the x value |
| IsYVisible | Visibility state of the y value |
| IsZVisible | Visibility state of the z value |
Methods
| Name | Description |
|---|---|
| ControlGUI(MaterialEditor) | Draws the control represented by this object. |