void Update() { Vector3 inputPosition = Vector3.zero; if (InputLocation == InputLocation.Right) { inputPosition = inputManager.RightPosition; } else { inputPosition = inputManager.LeftPosition; } Vector2 currentPoint = new Vector2(inputPosition.x, inputPosition.y) * (wheel.Radius + wheel.InnerPadding + wheel.Thickness); if (lineRenderer) { lineRenderer.AddPoint(currentPoint); } if (wheel) { int currentSection = wheel.SectionContains(currentPoint); if (currentSection != -1) { if (lastSection != currentSection) { if (lastSection == 0 || currentSection == 0) { traveledSections.Add(currentSection); sectionHitCount[currentSection]++; //Debug.Log($"Current section:{currentSection} : Hit count: {sectionHitCount[currentSection]}"); wheel.SetSectionColor(currentSection, ComboColors[Mathf.Min(sectionHitCount[currentSection], ComboColors.Count - 1)]); ComboIncreased?.Invoke(this, currentSection, traveledSections.Count); } } lastSection = currentSection; } } while (traveledSections.Count > MaxTraveledSections) { traveledSections.RemoveAt(0); } }
private void AddIncantationPoint(Vector3 point) { incantationLine.AddPoint(TransformIncantationPoint(point)); }