11using System.Collections;
12using System.Collections.Generic;
19 [CreateAssetMenu(menuName =
"Generator/Swizzle", order = 900)]
30 StringBuilder builder =
new StringBuilder();
32 for (
int i = 2; i <= 4; i++) {
33 string sourceType =
"Vector" + i;
35 for (
int j = 2; j <= 4; j++) {
36 string resultType =
"Vector" + j;
38 int[] components =
new int[j];
43 builder.Append(
"public static " + resultType +
" ");
44 for (
int k = 0; k < components.Length; k++) {
45 builder.Append(
"xyzw"[components[k]]);
47 builder.Append(
"(this " + sourceType +
" vector) {");
51 builder.Append(
"return new " + resultType +
"(");
52 for (
int k = 0; k < components.Length; k++) {
56 builder.Append(
"vector." +
"xyzw"[components[k]]);
64 }
while (Utils.NextTuple(components, i));
A convenient serializable representation of an asset folder. Only useful for editor scripts since ass...
virtual string Path
Gets or sets the folder path. This path will always be a path relative to the asset folder,...
const string TARGET_NAMESPACE
const string TEMPLATE_CODE_KEY
const string TEMPLATE_NAMESPACE
A Query object is a type of immutable ordered collection of elements that can be used to perform usef...