2019-01-28 16:17:15 -07:00
|
|
|
using System.Collections;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
using UnityEngine.UI;
|
|
|
|
|
|
|
|
|
|
public class setPosition : MonoBehaviour
|
|
|
|
|
{
|
2019-02-15 16:46:19 -07:00
|
|
|
robotNavXControl robotControl;
|
2019-01-28 16:17:15 -07:00
|
|
|
|
|
|
|
|
// Start is called before the first frame update
|
|
|
|
|
public void Start()
|
|
|
|
|
{
|
|
|
|
|
GameObject Robot = GameObject.Find("Robot");
|
2019-02-15 16:46:19 -07:00
|
|
|
robotControl = Robot.GetComponent<robotNavXControl>();
|
2019-01-28 16:17:15 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Update is called once per frame
|
|
|
|
|
public void Update()
|
|
|
|
|
{
|
|
|
|
|
Dropdown dd = GetComponent<Dropdown>();
|
|
|
|
|
// 1 = left, 2 = middle, and 3 = right
|
|
|
|
|
if (dd.value != 0)
|
|
|
|
|
{
|
|
|
|
|
if (dd.value == 1)
|
|
|
|
|
{
|
2019-02-15 16:46:19 -07:00
|
|
|
robotControl.transform.position = new Vector3(-50, 0, -256);
|
2019-01-28 16:17:15 -07:00
|
|
|
}
|
|
|
|
|
else if (dd.value == 2)
|
|
|
|
|
{
|
2019-02-15 16:46:19 -07:00
|
|
|
robotControl.transform.position = new Vector3(0, 0, -256);
|
2019-01-28 16:17:15 -07:00
|
|
|
}
|
|
|
|
|
else if (dd.value == 3)
|
|
|
|
|
{
|
2019-02-15 16:46:19 -07:00
|
|
|
robotControl.transform.position = new Vector3(50, 0, -256);
|
2019-01-28 16:17:15 -07:00
|
|
|
}
|
2019-02-15 16:46:19 -07:00
|
|
|
robotControl.initRot = robotControl.rot;
|
2019-01-28 16:17:15 -07:00
|
|
|
dd.value = 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|