SquareDash/Assets/Scripts/LevelScoller.cs
kingjuulian06 629d23e8de Fixed
2023-12-27 01:33:17 +01:00

32 lines
624 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class LevelScoller : MonoBehaviour
{
RectTransform myRectTransform;
public int i = 0;
private void Start()
{
myRectTransform = GetComponent<RectTransform>();
}
public void LeftClick()
{
if (i==0) {}
else {
myRectTransform.localPosition += Vector3.right * 1500;
i -= 1;
}
}
public void RightClick()
{
if (i==2) {}
else{
myRectTransform.localPosition += Vector3.left * 1500;
i += 1;
}
}
}