void Awake()
 {
     NetworkRoomManagerExt.singleton.sceneManager = this;
     networkRoomManagerExt = NetworkRoomManagerExt.singleton;
     projectManager        = networkRoomManagerExt.GetComponent <ProjectManager>();
     SetPlayerDic();
     QualitySettings.antiAliasing = 2;
     Debug.Log("The current MSAA level is " + QualitySettings.antiAliasing);
 }
 public void AddCompletedTask()
 {
     completedTasks++;
     if (completedTasks == totalTasks)
     {
         NetworkRoomManagerExt room = FindObjectOfType <NetworkRoomManagerExt>();
         room.ServerEndGameShowResults(PlayerType.crewmate);
     }
 }
Beispiel #3
0
 void InitSet()
 {
     networkRoomManagerExt = NetworkRoomManagerExt.singleton;
     projectManager        = networkRoomManagerExt.GetComponent <ProjectManager>();
     hapticMovement        = projectManager.GetComponent <HapticMovement>();
     for (int i = 0; i < mainEventMiddles.Length; i++)
     {
         mainEventMiddles[i].Init();
         dicMainEventMiddle.Add(mainEventMiddles[i].missionState, mainEventMiddles[i]);
     }
     StartCoroutine(ICheckPlayerSettingToStart());
 }
Beispiel #4
0
    /// <summary>
    /// Allows managers to be reassigned after a server is launched / quit
    /// </summary>
    private void CheckForManagers()
    {
        if (netManager == null || netDiscover == null)
        {
            GameObject NetManOb;
            NetManOb = GameObject.FindGameObjectWithTag("NetworkManager");

            if (netManager == null)
            {
                netManager = NetManOb.GetComponent <NetworkRoomManagerExt>();
            }

            if (netDiscover == null)
            {
                netDiscover = NetManOb.GetComponent <NetworkDiscoverExt>();
            }
        }
    }
Beispiel #5
0
 // Update is called once per frame
 void Update()
 {
     if (roomManager == null)
     {
         if (GameObject.Find("RoomManager"))
         {
             roomManager = GameObject.Find("RoomManager").GetComponent <NetworkRoomManagerExt>();
         }
     }
     if (TimeVal >= 0f)
     {
         TimeVal        = TimeVal - (.01f * Time.deltaTime);
         timerText.text = (Mathf.Round(TimeVal * 100) / 100).ToString();
     }
     else
     {
         Cursor.lockState = CursorLockMode.None;
         HunterLose       = true;
         HunterWin        = false;
         // Time.timeScale = 0;
     }
 }
    // public NetworkAnimator nanim;
    public void Start()
    {
        Timer       = GameObject.Find("Timer").GetComponent <timer>();
        roomManager = GameObject.Find("RoomManager").GetComponent <NetworkRoomManagerExt>();
        //nanim = gameObject.GetComponent<NetworkAnimator>();
        // nanim.animator = ProtectorAnim;
        if (isLocalPlayer)
        {
            foreach (NetworkRoomPlayer players in roomManager.roomSlots)
            {
                if (players.gameObject.GetComponent <NetworkIdentity>().hasAuthority)
                {
                    isHunter = players.gameObject.GetComponent <PlayerScript>().isHunter;
                    CmdisHunter(isHunter);
                }
            }


            //CmdParentThem();
        }
        // StartCoroutine(SpawnPlayer());
    }
Beispiel #7
0
    public void SetLobby(bool isHost, NetworkRoomPlayerExt myNetwork)
    {
        roomManager     = NetworkRoomManagerExt.singleton as NetworkRoomManagerExt;
        myPlayerNetwork = myNetwork;
        myPlayerLobby   = GetMyPlayerLobby();

        playersCount.text = GetPlayerCount().ToString();

        SetLobbyCode(roomManager.networkAddress);

        ready.onClick.AddListener(GetReady);

        if (isHost)
        {
            startGame.gameObject.SetActive(true);
            startGame.onClick.AddListener(delegate { roomManager.ServerChangeScene(roomManager.GameplayScene); });
            startGameUpdate = isStartInteractable;
        }
        else
        {
            startGame.gameObject.SetActive(false);
        }
    }
Beispiel #8
0
    /// <summary>
    /// Overider of bas implementation
    /// to allow extedned server details to be passed via a server request
    /// </summary>
    /// <param name="request"></param>
    /// <param name="endpoint"></param>
    /// <returns></returns>
    protected override ServerResponse ProcessRequest(ServerRequest request, IPEndPoint endpoint)
    {
        //Nab a refrence to the NetworkRoomManagerExt
        NetworkRoomManagerExt netManager = transport.gameObject.GetComponent <NetworkRoomManagerExt>();

        try
        {
            // this is an example reply message,  return your own
            // to include whatever is relevant for your game
            return(new ServerResponse
            {
                serverId = ServerId,
                uri = transport.ServerUri(),
                name = netManager.GetServerName(),
                maxPlayers = netManager.GetMaxPlayers(),
                currentPlayers = netManager.GetCurrentPlayers()
            });
        }
        catch (NotImplementedException)
        {
            Debug.LogError($"Transport {transport} does not support network discovery");
            throw;
        }
    }