protected void WriteTextureMatricies() { List <TextureMatrix> items = FindAllObjectsOfType <TextureMatrix>(); DynaBuffer.WriteUInt32(items.Count); foreach (var tx in items) { DynaBuffer.WriteULongPascalString(tx.Name); byte state = 0; if (tx.UseStatic && tx.UseDynamic) { state = 4; } else if (tx.UseStatic) { state = 1; } else if (tx.UseDynamic) { state = 2; } DynaBuffer.WriteByte(state); if (tx.UseStatic) { DynaBuffer.WriteFloat(tx.Rotation); DynaBuffer.WriteVector2F(tx.FixedShift); DynaBuffer.WriteVector2F(tx.FixedScale); DynaBuffer.WriteVector2F(tx.FixedCenter); } if (tx.UseDynamic) { DynaBuffer.WriteFloat(tx.SpinFreq); DynaBuffer.WriteVector2F(tx.ShiftFreq); DynaBuffer.WriteVector2F(tx.ScaleFreq); DynaBuffer.WriteVector2F(tx.Scale); DynaBuffer.WriteVector2F(tx.Center); } } }