示例#1
0
    private IEnumerator Start()
    {
        PlayerProperties.CreatePlayerHashtable();

        // initialize
        Transform t;

        t = transform.Find("Players");
        playerTranformLeft   = t.Find("Clients_Left");
        playerTransformRight = t.Find("Clients_Right");

        playerPrefab = playerTranformLeft.GetChild(0).gameObject;
        playerPrefab.SetActive(false);

        playerDictionary = new Dictionary <int, CharacterSelectPortrait>();

        // wait for mode choice
        while (ModeSelect.Mode == 0)
        {
            yield return(null);
        }

        // Online
        // Create portraits based on who's connected
        if (ModeSelect.Mode == 2)
        {
            var players = NetworkManager.getSortedPlayers;
            foreach (var p in players)
            {
                AddPlayer(p.ID);
            }
        }
    }
示例#2
0
        public bool OpCreateRoomWithProperties(string roomName, RoomOptions options, TypedLobby lobby)
        {
            PlayerProperties.CreatePlayerHashtable();
            options.CustomRoomProperties = RoomProperties.GetRoomHashtable();

            return(OpCreateRoom(roomName, options, lobby));
        }
示例#3
0
        public bool OpCreateRoomWithProperties(string roomName, RoomOptions options, TypedLobby lobby, string startingScene = "lobby")
        {
            options.CustomRoomPropertiesForLobby = new[] { PhotonConstants.propScene };
            options.CustomRoomProperties         = new Hashtable()
            {
                { PhotonConstants.propScene, startingScene }
            };

            PlayerProperties.CreatePlayerHashtable();

            return(OpCreateRoom(roomName, options, lobby));
        }
示例#4
0
        public bool OpJoinRoomWithProperties(string roomName)
        {
            PlayerProperties.CreatePlayerHashtable();

            return(OpJoinRoom(roomName));
        }