// Update is called once per frame void Update() { if (Vector2.Distance(transform.position, points[actualPoint].position) < .01f) { if (actualPoint < points.Length - 1) { actualPoint++; } else if (actualPoint == points.Length - 1) { actualPoint = 0; } lerp.Move(points[actualPoint]); Flip(); } }
void Select(int button) { if (button == 0) { button = 1; } else if (button == 5) { button = 4; } else { lerpMovement.Move(button); selected = button; playButton.interactable = true; foreach (GameObject iconButton in buttons) { iconButton.transform.GetChild(0).GetComponent <Image>().sprite = normalBorder; } buttons[button - 1].transform.GetChild(0).GetComponent <Image>().sprite = goldenBorder; } }
// Start is called before the first frame update void Start() { lerp = GetComponent <LerpMovement>(); lerp.Move(points[actualPoint]); }