public z_AttributeLayout(z_MeshChannel channel, z_ComponentIndex index, Vector2 range, int mask) { this.channel = channel; this.index = index; this.range = range; this.mask = mask; }
public static string GetString(this z_ComponentIndex component, z_ComponentIndexType type = z_ComponentIndexType.Vector) { int ind = ((int)component); if (type == z_ComponentIndexType.Vector) { return(ind == 0 ? "X" : (ind == 1 ? "Y" : (ind == 2 ? "Z" : "W"))); } else if (type == z_ComponentIndexType.Color) { return(ind == 0 ? "R" : (ind == 1 ? "G" : (ind == 2 ? "B" : "A"))); } else { return(ind.ToString()); } }
public static float GetValueAtIndex(this Vector3 value, z_ComponentIndex index) { switch (index) { case z_ComponentIndex.X: return(value.x); case z_ComponentIndex.Y: return(value.y); case z_ComponentIndex.Z: return(value.z); default: return(0f); } }
public static float GetValueAtIndex(this Color value, z_ComponentIndex index) { switch (index) { case z_ComponentIndex.R: return(value.r); case z_ComponentIndex.G: return(value.g); case z_ComponentIndex.B: return(value.b); case z_ComponentIndex.A: return(value.a); default: return(0f); } }
public static uint ToFlag(this z_ComponentIndex e) { int i = ((int)e) + 1; return((uint)(i < 3 ? i : i == 3 ? 4 : 8)); }
public z_AttributeLayout(z_MeshChannel channel, z_ComponentIndex index, Vector2 range, int mask, string targetProperty, Texture2D texture = null) : this(channel, index, range, mask) { this.propertyTarget = targetProperty; this.previewTexture = texture; }
public z_AttributeLayout(z_MeshChannel channel, z_ComponentIndex index) : this(channel, index, Vector2.up, DefaultMask) { }