private void Start() { _startPosition = GenerateLevel.GetStartPos(); _lastPosition = GenerateLevel.GetStartPos(); GuiHandler.UpdateDistance(Vector3.Distance(_startPosition, _lastPosition)); if (Settings.GameType == 1) { if (TotalPointsEndless < 1f) { var total = PlayerPrefs.GetFloat("TotalPointsEndless", TotalPointsEndless); GuiHandler.UpdatePoints(total); } else { GuiHandler.UpdatePoints(TotalPointsEndless); } } else { if (TotalPoints < 1f) { var total = PlayerPrefs.GetFloat("TotalPoints", TotalPoints); GuiHandler.UpdatePoints(total); } else { GuiHandler.UpdatePoints(TotalPoints); } } }
public void BoostStart() { var end = GenerateLevel.GetStartPos(); var start = GenerateLevel.GetEndPos(); var place = Vector3.Lerp(start, end, 0.5f); MainBall._active = false; MainBall._trail.gameObject.SetActive(true); MainBall.transform.DOMove(place, 2f).OnComplete(() => { MainBall._trail.time = 0f; MainBall._active = true; MainBall._trail.gameObject.SetActive(false); }); }