// Update is called once per frame void Update() { if (!finished && touchPosition != null) { Vector3 point = touchPosition; point.z = 4.9f; float newDistance; Vector3 pointOnCurve = curve.GetComponent <BGCcMath>().CalcPositionByClosestPoint(point, out newDistance); if (newDistance - distance < 1 && newDistance - distance > 0) { distance = FillIntoLine(pointOnCurve, distance, newDistance); particle.transform.position = pointOnCurve; startdrawing = true; } else if (newDistance == math.GetDistance() && newDistance - distance < 1 && startdrawing) { finished = true; particle.gameObject.SetActive(false); StretchLine(); game.Proceed(); } } }
public override void OnTap() { game.Proceed(); GetComponent <Collider2D>().enabled = false; enabled = false; }