private HitCircle CreateHitCircle(int index, string[] hitObject) { var instance = Instantiate(HitCircleTransform, PlayArea).GetComponent <HitCircle>(); instance.TapTapAimSetup = this; var format = new CircleFormat(hitObject); if (format.group == PrevGroupID) { instance.GroupNumberShownOnCircle = GroupIDCount += 1; } else { PrevGroupID = format.group; instance.GroupNumberShownOnCircle = GroupIDCount = 1; } instance.GetComponent <RectTransform>().anchorMin = new Vector2(0, 0); instance.GetComponent <RectTransform>().anchorMax = new Vector2(0, 0); instance.GetComponent <RectTransform>().anchoredPosition = new Vector3(format.x, format.y, 0); instance.transform.localScale = new Vector2(1f, 1f); instance.PerfectInteractionTimeInMs = GetPerfectTime(format); return(instance); }
private SliderHitCircle CreateSliderHitCircle(CircleFormat circleFormat) { var instance = Instantiate(SliderHitCircleTransform, PlayArea).GetComponent <SliderHitCircle>(); instance.TapTapAimSetup = this; instance.name = "Hit Circle"; instance.GroupNumberShownOnCircle = GroupIDCount; instance.GetComponent <RectTransform>().anchorMin = new Vector2(0, 0); instance.GetComponent <RectTransform>().anchorMax = new Vector2(0, 0); instance.transform.GetComponent <RectTransform>().anchoredPosition = new Vector3(circleFormat.x, circleFormat.y, 0); instance.transform.localScale = new Vector2(1f, 1f); instance.PerfectInteractionTimeInMs = GetPerfectTime(circleFormat); return(instance); }
private HitSlider CreateHitSlider(int index, string[] hitObject) { var format = new SliderFormat(hitObject); if ((!showQuadraticSlider && format.type == SliderType.BezierCurve)) { return(null); // not implemented yet } var instance = Instantiate(HitSliderTransform, PlayArea).GetComponent <HitSlider>(); instance.TripMs = (float)format.tripMs; instance.TapTapAimSetup = this; var transform = instance.transform.GetComponent <RectTransform>(); transform.anchoredPosition = new Vector3(0, 0, 0); transform.sizeDelta = new Vector3(0, 0, -0.1f); transform.anchorMin = new Vector2(0f, 0f); transform.anchorMax = new Vector2(0f, 0f); instance.transform.localScale = new Vector2(1f, 1f); if (format.group == PrevGroupID) { instance.Number = GroupIDCount += 1; } else { PrevGroupID = format.group; instance.Number = GroupIDCount = 1; } var circleFormat = new CircleFormat { x = format.x, y = format.y, timeInMs = format.timeInMs, @group = format.group }; var sliderHitcircleInstance = CreateSliderHitCircle(circleFormat); sliderHitcircleInstance.transform.SetParent(instance.transform); sliderHitcircleInstance.name = "SliderHitCircle"; sliderHitcircleInstance.transform.localPosition = format.points.First(); var sliderPositionRingInstance = Instantiate(SliderPositionRing, instance.transform).GetComponent <SliderPositionRing>(); sliderPositionRingInstance.GetComponent <RectTransform>().position = sliderHitcircleInstance.GetComponent <RectTransform>().position; sliderPositionRingInstance.name = "SliderPositionRing"; sliderPositionRingInstance.TapTapAimSetup = this; Slider sliderInstance = NewSliderInstance(format, instance, sliderPositionRingInstance); instance.SetUp( sliderHitcircleInstance, sliderInstance, sliderPositionRingInstance, GetPerfectTime(format), format.sliderTrips, this); return(instance); }