public static TSSMaterialProperty Clone(this TSSMaterialProperty sourceProperty) { Color[] newColorValues = (sourceProperty.colorValues == null || sourceProperty.colorValues.Length == 0) ? sourceProperty.colorValues : new Color[TSSItemBase.stateCount]; if (sourceProperty.colorValues != null) { for (int i = 0; i < sourceProperty.colorValues.Length; i++) { newColorValues[i] = new Color(sourceProperty.colorValues[i].r, sourceProperty.colorValues[i].g, sourceProperty.colorValues[i].b, sourceProperty.colorValues[i].a); } } AnimationCurve newAnimationCurve = (sourceProperty.curve == null ? null : sourceProperty.curve.Clone()); return(new TSSMaterialProperty(sourceProperty.type) { name = sourceProperty.name, singleValues = sourceProperty.singleValues, integerValues = sourceProperty.integerValues, colorValues = newColorValues, curve = newAnimationCurve, gradient = sourceProperty.gradient, vector2values = sourceProperty.vector2values, vector3values = sourceProperty.vector3values, vector4values = sourceProperty.vector4values }); }
public TSSTween(TSSItem item) { this.item = item; this.matProperty = null; }