public override void SetFromLight(BTL.Light l) { base.SetFromLight(l); UnkC8 = l.UnkC8; UnkCC = l.UnkCC; UnkD0 = l.UnkD0; UnkD4 = l.UnkD4; UnkD8 = l.UnkD8; UnkDC = l.UnkDC; UnkE0 = l.UnkE0; }
public override BTL.Light Serialize(GameObject parent, BTL.Light light = null) { var l = new BTL.Light(); base.Serialize(parent, l); l.UnkC8 = UnkC8; l.UnkCC = UnkCC; l.UnkD0 = UnkD0; l.UnkD4 = UnkD4; l.UnkD8 = UnkD8; l.UnkDC = UnkDC; l.UnkE0 = UnkE0; return(l); }
public virtual BTL.Light Serialize(GameObject parent, BTL.Light light = null) { BTL.Light l = light; if (light == null) { l = new BTL.Light(); } l.Name = parent.name; l.Position = new System.Numerics.Vector3(parent.transform.localPosition.x, parent.transform.localPosition.y, parent.transform.localPosition.z); l.Unk00 = Unk00; l.Unk04 = Unk04; l.Unk08 = Unk08; l.Unk0C = Unk0C; l.Type = LightType; l.Unk1C = Unk1C; l.DiffuseColor = System.Drawing.Color.FromArgb((byte)(DiffuseColor.a * 255.0f), (byte)(DiffuseColor.r * 255.0f), (byte)(DiffuseColor.g * 255.0f), (byte)(DiffuseColor.b * 255.0f)); l.DiffusePower = DiffusePower; l.SpecularColor = System.Drawing.Color.FromArgb((byte)(SpecularColor.a * 255.0f), (byte)(SpecularColor.r * 255.0f), (byte)(SpecularColor.g * 255.0f), (byte)(SpecularColor.b * 255.0f)); l.SpecularPower = SpecularPower; l.ConeAngle = ConeAngle; l.CastShadows = CastsShadows; l.Unk30 = Unk30; l.Unk34 = Unk34; //l.Rotation = new System.Numerics.Vector3(Rotation.x * Mathf.Deg2Rad, Rotation.y * Mathf.Deg2Rad, Rotation.z * Mathf.Deg2Rad); //l.Rotation = ConvertEuler(parent.transform.localEulerAngles); l.Rotation = new System.Numerics.Vector3(parent.transform.eulerAngles.x * Mathf.Deg2Rad, parent.transform.eulerAngles.y * Mathf.Deg2Rad, parent.transform.eulerAngles.z * Mathf.Deg2Rad); print($@"{l.Name}: {Rotation}, {parent.transform.eulerAngles} -> {l.Rotation * Mathf.Rad2Deg}"); l.Unk50 = Unk50; l.Unk54 = Unk54; l.Radius = Radius; l.Unk5C = Unk5C; l.Unk64 = Unk64; l.Unk68 = Unk68; l.ShadowColor = System.Drawing.Color.FromArgb((byte)(ShadowColor.a * 255.0f), (byte)(ShadowColor.r * 255.0f), (byte)(ShadowColor.g * 255.0f), (byte)(ShadowColor.b * 255.0f)); l.Unk70 = Unk70; l.FlickerIntervalMin = FlickerIntervalMin; l.FlickerIntervalMax = FlickerIntervalMax; l.FlickerBrightnessMult = FlickerBrightnessMult; l.Unk98 = ConeAngleWidthDS2; l.Unk9C = NearPlane; l.UnkA0 = UnkA0; l.Sharpness = Sharpness; l.UnkAC = UnkAC; l.Width = Width; l.UnkBC = UnkBC; l.UnkC0 = UnkC0; l.UnkC4 = UnkC4; return(l); }
public virtual BTL.Light Serialize(GameObject parent, BTL.Light light = null) { BTL.Light l = light; if (light == null) { l = new BTL.Light(); } l.Name = parent.name; l.Position = new System.Numerics.Vector3(parent.transform.localPosition.x, parent.transform.localPosition.y, parent.transform.localPosition.z); l.Unk00 = Unk00; l.Unk04 = Unk04; l.Unk08 = Unk08; l.Unk0C = Unk0C; l.Unk18 = Unk18; l.Unk1C = Unk1C; l.DiffuseColor = new Color((byte)(DiffuseColor.a * 255.0f), (byte)(DiffuseColor.r * 255.0f), (byte)(DiffuseColor.g * 255.0f), (byte)(DiffuseColor.b * 255.0f)); l.DiffusePower = DiffusePower; l.SpecularColor = new Color((byte)(SpecularColor.a * 255.0f), (byte)(SpecularColor.r * 255.0f), (byte)(SpecularColor.g * 255.0f), (byte)(SpecularColor.b * 255.0f)); l.SpecularPower = SpecularPower; l.ConeAngle = ConeAngle; l.Unk27 = CastsShadows; l.Unk30 = Unk30; l.Unk34 = Unk34; l.Rotation = new System.Numerics.Vector3(Rotation.x * Mathf.Deg2Rad, Rotation.y * Mathf.Deg2Rad, Rotation.z * Mathf.Deg2Rad); l.Unk50 = Unk50; l.Unk54 = Unk54; l.Radius = Radius; l.Unk5C = Unk5C; l.Unk64 = Unk64; l.Unk68 = Unk68; l.Unk6C = Unk6C; l.Unk70 = Unk70; l.Unk74 = Unk74; l.Unk78 = Unk78; l.Unk7C = Unk7C; l.Unk98 = Unk98; l.Unk9C = Unk9C; l.UnkA0 = UnkA0; l.UnkA4 = UnkA4; l.UnkAC = UnkAC; l.Width = Width; l.UnkBC = UnkBC; l.UnkC0 = UnkC0; l.UnkC4 = UnkC4; return(l); }
public virtual void SetFromLight(BTL.Light l) { Unk00 = l.Unk00; Unk04 = l.Unk04; Unk08 = l.Unk08; Unk0C = l.Unk0C; LightType = l.Type; Unk1C = l.Unk1C; DiffuseColor = new Color((float)l.DiffuseColor.R / 255.0f, (float)l.DiffuseColor.G / 255.0f, (float)l.DiffuseColor.B / 255.0f, (float)l.DiffuseColor.A / 255.0f); DiffusePower = l.DiffusePower; SpecularColor = new Color((float)l.SpecularColor.R / 255.0f, (float)l.SpecularColor.G / 255.0f, (float)l.SpecularColor.B / 255.0f, (float)l.SpecularColor.A / 255.0f); SpecularPower = l.SpecularPower; ConeAngle = l.ConeAngle; CastsShadows = l.CastShadows; Unk30 = l.Unk30; Unk34 = l.Unk34; Rotation = new Vector3(l.Rotation.X * Mathf.Rad2Deg, l.Rotation.Y * Mathf.Rad2Deg, l.Rotation.Z * Mathf.Rad2Deg); Unk50 = l.Unk50; Unk54 = l.Unk54; Radius = l.Radius; Unk5C = l.Unk5C; Unk64 = l.Unk64; Unk68 = l.Unk68; ShadowColor = new Color((float)l.ShadowColor.R / 255.0f, (float)l.ShadowColor.G / 255.0f, (float)l.ShadowColor.B / 255.0f, (float)l.ShadowColor.A / 255.0f); Unk70 = l.Unk70; FlickerIntervalMin = l.FlickerIntervalMin; FlickerIntervalMax = l.FlickerIntervalMax; FlickerBrightnessMult = l.FlickerBrightnessMult; Unk80 = l.Unk80; Unk84 = l.Unk84; Unk88 = l.Unk88; Unk90 = l.Unk90; ConeAngleWidthDS2 = l.Unk98; NearPlane = l.Unk9C; UnkA0 = l.UnkA0; Sharpness = l.Sharpness; UnkAC = l.UnkAC; Width = l.Width; UnkBC = l.UnkBC; UnkC0 = l.UnkC0; UnkC4 = l.UnkC4; }
public virtual void SetFromLight(BTL.Light l) { Unk00 = l.Unk00; Unk04 = l.Unk04; Unk08 = l.Unk08; Unk0C = l.Unk0C; Unk18 = l.Unk18; Unk1C = l.Unk1C; DiffuseColor = new Color((float)l.DiffuseColor.r / 255.0f, (float)l.DiffuseColor.g / 255.0f, (float)l.DiffuseColor.b / 255.0f, (float)l.DiffuseColor.a / 255.0f); DiffusePower = l.DiffusePower; SpecularColor = new Color((float)l.SpecularColor.r / 255.0f, (float)l.SpecularColor.g / 255.0f, (float)l.SpecularColor.b / 255.0f, (float)l.SpecularColor.a / 255.0f); SpecularPower = l.SpecularPower; ConeAngle = l.ConeAngle; CastsShadows = l.Unk27; Unk30 = l.Unk30; Unk34 = l.Unk34; Rotation = new Vector3(l.Rotation.X * Mathf.Rad2Deg, l.Rotation.Y * Mathf.Rad2Deg, l.Rotation.Z * Mathf.Rad2Deg); Unk50 = l.Unk50; Unk54 = l.Unk54; Radius = l.Radius; Unk5C = l.Unk5C; Unk64 = l.Unk64; Unk68 = l.Unk68; Unk6C = l.Unk6C; Unk70 = l.Unk70; Unk74 = l.Unk74; Unk78 = l.Unk78; Unk7C = l.Unk7C; Unk98 = l.Unk98; Unk9C = l.Unk9C; UnkA0 = l.UnkA0; UnkA4 = l.UnkA4; UnkAC = l.UnkAC; Width = l.Width; UnkBC = l.UnkBC; UnkC0 = l.UnkC0; UnkC4 = l.UnkC4; }