public static ObstacleData ConvertObstacle(ObstacleData obstacle, RawObstacleData rawData, float jumpSpeed, float secondEquivalentOfBeat, float3 lineOffset) { obstacle.TransformData = ConvertTransform(obstacle.TransformData, rawData.CustomData, jumpSpeed, secondEquivalentOfBeat, lineOffset); obstacle.TransformData.Scale.c2.z = PlacementHelper.ConvertDurationToZScale((float)rawData.Duration, jumpSpeed, secondEquivalentOfBeat) / 2; obstacle.TransformData.Position += new float3(obstacle.TransformData.Scale.c0.x / 2 + lineOffset.x * 1.6f, obstacle.TransformData.Scale.c1.y / 2, obstacle.TransformData.Scale.c2.z / 2); return(obstacle); }
public static ObstacleData ConvertObstacleData(ObstacleData obstacle, RawObstacleData rawData, float jumpSpeed, float secondEquivalentOfBeat, float3 lineOffset) { obstacle.TransformData.Position = GetPosition(rawData.LineIndex, 0, lineOffset); float height = 0; float startHeight = 0; if (rawData.Type >= 40001 && rawData.Type <= 4005000) { int type = rawData.Type - 4001; height = type / 1000; startHeight = type % 1000; float normalHeight = lineOffset.y * 2f; obstacle.TransformData.Position.y = startHeight / 1000f * normalHeight; } else if (rawData.Type >= 1000) { height = rawData.Type; height -= 1000; } obstacle.TransformData.Scale.c1.y = height / 1000f; if (rawData.Type == 0) { obstacle.TransformData.Position.y = 1; } else if (rawData.Type == 1) { obstacle.TransformData.Position.y = 2; } if (rawData.Width >= 1000) { obstacle.TransformData.Scale.c0.x = (rawData.Width - 1000f) / 1000f; } else { obstacle.TransformData.Scale.c0.x = rawData.Width; } //obstacle.TransformData.Scale.c0.x *= lineOffset.x; obstacle.TransformData.Scale.c2 = new float4(0, 0, PlacementHelper.ConvertDurationToZScale((float)rawData.Duration, jumpSpeed, secondEquivalentOfBeat) / 2, 0); obstacle.TransformData.Scale.c2.z = PlacementHelper.ConvertDurationToZScale((float)rawData.Duration, jumpSpeed, secondEquivalentOfBeat) / 2; obstacle.TransformData.Position += new float3(lineOffset.x * 1.6f, obstacle.TransformData.Scale.c1.y / 2, obstacle.TransformData.Scale.c2.z / 2); return(obstacle); }