public SpatialInfo Unmap(SpatialInfo parent) { if (parent == null) { return(this); } var unmapped = new SpatialInfo(); unmapped.Position = new Vector2( Position.x * parent.Scale.x, Position.y * parent.Scale.y); unmapped.Scale = new Vector2( Scale.x * parent.Scale.x, Scale.y * parent.Scale.y); unmapped.Angle_Deg = Angle_Deg; if (parent.Scale.x * parent.Scale.y < 0) { unmapped.Angle_Deg = 360 - unmapped.Angle_Deg; } unmapped.Spin = Spin; return(unmapped); }
protected override void Parse(XmlElement element) { base.Parse(element); var boneElem = element ["bone"]; Spatial = new SpatialInfo(boneElem); Color tint = Color.white; tint.r = boneElem.GetFloat("r", 1.0f); tint.g = boneElem.GetFloat("g", 1.0f); tint.b = boneElem.GetFloat("b", 1.0f); tint.a = boneElem.GetFloat("a", 1.0f); Tint = tint; }
protected override void Parse(XmlElement element, Timeline timeline) { base.Parse(element, timeline); var boneElem = element["bone"]; Spatial = new SpatialInfo(boneElem); Color tint = Color.white; tint.r = boneElem.GetFloat("r", 1.0f); tint.g = boneElem.GetFloat("g", 1.0f); tint.b = boneElem.GetFloat("b", 1.0f); tint.a = boneElem.GetFloat("a", 1.0f); Tint = tint; }
public SpatialInfo Unmap(SpatialInfo parent) { if (parent == null) return this; var unmapped = new SpatialInfo(); unmapped.Position = new Vector2( Position.x * parent.Scale.x, Position.y * parent.Scale.y); unmapped.Scale = new Vector2( Scale.x * parent.Scale.x, Scale.y * parent.Scale.y); unmapped.Angle_Deg = Angle_Deg; unmapped.Spin = Spin; return unmapped; }
protected override void Parse(XmlElement element, Timeline timeline) { base.Parse(element, timeline); var objElement = element[XmlKey]; File = GetFile(objElement); Spatial = new SpatialInfo(objElement); Vector2 pivot; pivot.x = objElement.GetFloat("pivot_x", 0); pivot.y = objElement.GetFloat("pivot_y", 0); Color tint = Color.white; tint.r = objElement.GetFloat("r", 1.0f); tint.g = objElement.GetFloat("g", 1.0f); tint.b = objElement.GetFloat("b", 1.0f); tint.a = objElement.GetFloat("a", 1.0f); Tint = tint; }
private SpatialInfo ComputeUnmapped() { SpatialInfo spatialInfo = null; var spatial = Referenced as SpatialTimelineKey; if (spatial != null) { spatialInfo = spatial.Spatial; } else { Debug.LogError("Non-Spatial Ref type!!"); } if (Parent != null) { spatialInfo = spatialInfo.Unmap(Parent.Unmapped); } return(spatialInfo); }
protected override void Parse(XmlElement element, Timeline timeline) { base.Parse(element, timeline); var objElement = element[XmlKey]; File = GetFile(objElement); Spatial = new SpatialInfo(objElement); Vector2 pivot; pivot.x = objElement.GetFloat("pivot_x", File.Pivot.x); pivot.y = objElement.GetFloat("pivot_y", File.Pivot.y); Pivot = pivot; Color tint = Color.white; tint.r = objElement.GetFloat("r", 1.0f); tint.g = objElement.GetFloat("g", 1.0f); tint.b = objElement.GetFloat("b", 1.0f); tint.a = objElement.GetFloat("a", 1.0f); Tint = tint; }