You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

51 lines
1.0 KiB

  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.Networking;
  5. using Networking.Server;
  6. using Networking;
  7. public class portalTesting : MonoBehaviour
  8. {
  9. public ConnectionHandler clientDataList;
  10. public List<ClientData> ConnectedClients;
  11. public PortalSetup ps;
  12. void Start(){
  13. ConnectedClients = clientDataList.ConnectedClients;
  14. }
  15. // Update is called once per frame
  16. void Update()
  17. {
  18. if(Input.GetKeyDown(KeyCode.A)){
  19. ConnectedClients[0].collected++;
  20. if(ConnectedClients[0].collected >= 5){
  21. ps.validIndex.Add(0);
  22. }
  23. }
  24. if(Input.GetKeyDown(KeyCode.B)){
  25. ConnectedClients[1].collected++;
  26. if(ConnectedClients[1].collected >= 5){
  27. ps.validIndex.Add(1);
  28. }
  29. }
  30. if(Input.GetKeyDown(KeyCode.C)){
  31. ConnectedClients[2].collected++;
  32. if(ConnectedClients[2].collected >= 5){
  33. ps.validIndex.Add(2);
  34. }
  35. }
  36. if(Input.GetKeyDown(KeyCode.D)){
  37. ConnectedClients[3].collected++;
  38. if(ConnectedClients[3].collected >= 5){
  39. ps.validIndex.Add(3);
  40. }
  41. }
  42. }
  43. }