Пример #1
0
        public override void ChangePlayerQuality(int id, int newQuality)
        {
            if (newQuality < 1)
            {
                newQuality = 1;
            }
            else if (newQuality > 3)
            {
                newQuality = 3;
            }

            var playerCurrent = GetPlayerByID(id);

            GameObject newPrefab = GetSimulatedStudentAvatarByQuality(newQuality);
            NetworkedPlayerSimulator newPlayer = NetworkingManager.Instantiate(newPrefab,
                                                                               playerCurrent.transform.position,
                                                                               playerCurrent.transform.rotation,
                                                                               playerCurrent.transform.parent).GetComponent <NetworkedPlayerSimulator>();

            newPlayer.id         = playerCurrent.id;
            newPlayer.quality    = newQuality;
            newPlayer.isSpeaking = playerCurrent.isSpeaking;
            //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            players[players.IndexOf(playerCurrent)] = newPlayer;

            NetworkingManager.Destroy(playerCurrent.gameObject);
        }
Пример #2
0
        public virtual void PlayerConnect(int Player, bool isTeacher)
        {
            var    loadedPlayer       = GetPlayer(isTeacher);
            Player instantiatedPlayer = NetworkingManager.Instantiate(loadedPlayer).GetComponent <Player>();

            instantiatedPlayer.id = NetworkingManager.GetNewPlayerID();
            teacherId             = instantiatedPlayer.id;

            players.Add(instantiatedPlayer);
            NetworkingManager.rigsData.Add(instantiatedPlayer.id, instantiatedPlayer.GetRigData());

            //if seat system was implemented positon would be updated here
            //insead it is implemnted in the override in MultiplayerRoomSimulator.cs
            //
            //instantiatedPlayer.transform.position = GetSeatPositon();
            //instantiatedPlayer.transform.localRotation *= GetSeatRotation();
        }
Пример #3
0
        public override void PlayerConnect(int id, bool isTeacher)
        {
            var    loadedPlayer       = GetSimulatedPlayer(isTeacher);
            Player instantiatedPlayer = NetworkingManager.Instantiate(loadedPlayer).GetComponent <Player>();

            instantiatedPlayer.id = NetworkingManager.GetNewPlayerID();
            teacherId             = instantiatedPlayer.id;

            players.Add(instantiatedPlayer);
            NetworkingManager.rigsData.Add(instantiatedPlayer.id, instantiatedPlayer.GetRigData());

            //to be replaced by a seat system where the enviornement puts forth a list of available seats in the enviorment
            //and moves the player at an available seat or one they choose before/while connected

            if (!isTeacher)
            {
                players[players.Count - 1].transform.position       = GetSeatPositon();
                players[players.Count - 1].transform.localRotation *= GetSeatRotation();
            }
        }