Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void Update()
- {
- /* TODO : TO BE REWORKED, may not use a Raycast in the future, need to be discussed with GDs */
- Transform cam = Camera.main.transform;
- RaycastHit hit;
- if (Physics.Raycast(cam.position , cam.forward , out hit) && hit.collider.tag == "BrokenRobot")
- AddPlayer(hit.collider.gameObject);
- /**************************************************************************************/
- if (player.GetButton("Switch")) {
- Debug.Log("switch");
- if ((currentPlayerIndex + 1) == playerArray.Count && playerArray.Count == 1) {
- return;
- } else if(timer < switchTime) {
- timer += 1 * Time.deltaTime;
- Debug.Log(timer);
- } else if ((currentPlayerIndex + 1) != playerArray.Count) {
- Activate(currentPlayerIndex + 1);
- resetTimer();
- }
- else if ((currentPlayerIndex + 1) == playerArray.Count && playerArray.Count != 1) {
- Activate(0);
- resetTimer();
- }
- }
- if (player.GetButtonUp("Switch")) {
- resetTimer();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement