public static ColorTransform ReadColorTransform(byte[] data, Cursor cursor){
ColorTransform ctr = new ColorTransform();
ctr.add = new Color (0, 0, 0 ,0);
ctr.multiply = new Color32 (0, 0, 0, 0);
int mtype = Utils.ReadInt32(data, cursor);
if (mtype==1) {
ctr.multiply = new Color(1, 1, 1, 1);
}else if (mtype==2){
Color color = new Color();
color.r = Utils.ReadFloat(data, cursor);
color.g = Utils.ReadFloat(data, cursor);
color.b = Utils.ReadFloat(data, cursor);
color.a = Utils.ReadFloat(data, cursor);
ctr.multiply = color;
}
int atype = Utils.ReadInt32(data, cursor);
if (atype==1) {
ctr.add = new Color(255, 255, 255, 255);
}else if (atype==2){
Color32 color = new Color();
color.r = Utils.ReadByte(data, cursor);
color.g = Utils.ReadByte(data, cursor);
color.b = Utils.ReadByte(data, cursor);
color.a = Utils.ReadByte(data, cursor);
ctr.add = color;
}
return ctr;
}