Пример #1
0
 private void ReceiveData(ushort senderID, byte tag, ushort subject, object data)
 {
     if (senderID == networkID)
     {
         if (subject == TagIndex.ControllerSubjects.SpawnPokemon)
         {
             Networking.DeserialisePokemonData(data, senderID, this);
         }
         if (tag == TagIndex.PlayerUpdate)
         {
             if (subject == TagIndex.PlayerUpdateSubjects.Position)
             {
                 transform.position = (Vector3)data;
             }
             if (subject == TagIndex.PlayerUpdateSubjects.Rotation)
             {
                 transform.rotation = (Quaternion)data;
             }
             if (subject == TagIndex.PlayerUpdateSubjects.AnimatorFloat)
             {
                 Networking.DeserialiseTrainerAnimFloat(data, components.animator);
             }
             if (subject == TagIndex.PlayerUpdateSubjects.AnimatorBool)
             {
                 Networking.DeserialiseTrainerAnimBool(data, components.animator);
             }
         }
     }
 }