void Start() { // for saving data GameObject player = GameObject.Find("Player"); sp = player.GetComponent <SP_RunTrain>(); pc = player.GetComponent <PC_RunTrain>(); Debug.Log(sp.numTraversals); }
public void Awake() { GameObject player = GameObject.Find("Player"); sp = player.GetComponent <SP_RunTrain>(); rotary = player.GetComponent <RR_RunTrain>(); dl = player.GetComponent <DL_RunTrain>(); panoCam = GameObject.Find("panoCamera"); panoCam.transform.eulerAngles = new Vector3(0.0f, -90.0f, 0.0f); reward = GameObject.Find("Reward"); initialPosition = new Vector3(0f, 6f, -5.0f); }
void Start() { // connect to Arduino uno serial port connect(port, 57600, true, 4); Debug.Log("Connected to rotary encoder serial port"); // set speed speedBool = 0; // connect to playerController script GameObject player = GameObject.Find("Player"); pc = player.GetComponent <PC_RunTrain>(); sp = player.GetComponent <SP_RunTrain>(); }