public void UpdatePoints() { if (Input.GetMouseButton(0) && SS.GetAngle() >= 0 && SS.GetAngle() <= 89.9f) { for (int i = 0; i < points.Count; i++) { updatedPos.x = SS.midPoint.transform.position.x + i * (SS.GetDistance(SS.GetVelocity()) / pointNum); updatedPos.y = SS.midPoint.transform.position.y + SS.GetHeight(SS.GetVelocity(), pointNum, i); updatedPos.z = 0; points[i].transform.position = updatedPos; points[i].gameObject.SetActive(true); } } else { for (int i = 0; i < points.Count; i++) { points[i].gameObject.SetActive(false); } } }
public void UpdatePoints() { if (Input.GetMouseButton(0) && Slingshot.GetAngle() > 0 && Slingshot.GetAngle() <= 89.9f) { for (var i = 0; i < PointsList.Count; i++) { _updatedPosition.x = Slingshot.ReleasePointTransform.transform.position.x + i * (Slingshot.GetDistance(Slingshot.GetVelocity()) / PointNumber); _updatedPosition.y = Slingshot.ReleasePointTransform.transform.position.y + Slingshot.GetHeight(Slingshot.GetVelocity(), PointNumber, i); _updatedPosition.z = 0; PointsList[i].transform.position = _updatedPosition; PointsList[i].gameObject.SetActive(true); } } else { for (var i = 0; i < PointsList.Count; i++) { PointsList[i].gameObject.SetActive(false); } } }