Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [SerializeField]
- private int index, index2 = 0;
- [SerializeField]
- private Vector3[] Myposic1, Myposic2;
- [SerializeField]
- private Button left, right;
- [SerializeField]
- private float time;
- public int slide = 0;
- public void player(int valor) {
- index = index + valor;
- }
- public void previous()
- {
- slide--;
- chamar();
- }
- public void next()
- {
- slide++;
- chamar();
- }
- void chamar()
- {
- if (slide <= 0)
- {
- slide = 0;
- }
- if (slide >= 1)
- {
- slide = 1;
- }
- if (slide == 0)
- {
- this.transform.position = Vector3.Lerp (this.transform.position, Myposic1[index], Time.deltaTime*time);
- if (index == Myposic1.Length - 1)
- right.interactable = false;
- else
- right.interactable = true;
- if (index == 0)
- left.interactable = false;
- else
- left.interactable = true;
- Debug.Log("1posic");
- }
- if (slide == 1)
- {
- this.transform.position = Vector3.Lerp (this.transform.position, Myposic2 [index], Time.deltaTime*time);
- if (index == Myposic2.Length - 1)
- right.interactable = false;
- else
- right.interactable = true;
- if (index == 0)
- left.interactable = false;
- else
- left.interactable = true;
- Debug.Log("2posic");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement