Так что я кодирование многопользовательской игры в единстве с SmartFoxServer, я пытался создать скрипт, который будет подключить мой клиент к серверу, но я получил ошибку:Невозможно ссылаться system.runtime единства
"The type 'System.Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Runtime, Version=4.0.10.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
Эта линия была показана над public SmartFox _client;
Я попытался пойти на панель решений и добавить ссылку на System.Runtime
, но я не мог найти его, ближайший я смог найти было System.Runtime.Serialization.
Код вклеен ниже, спасибо заранее.
using UnityEngine;
using System.Collections;
using Sfs2X;
using Sfs2X.Core;
using Sfs2X.Requests;
using Sfs2X.Entities;
public class Client : MonoBehaviour {
private string host="localhost";
private int port= 9933;
public SmartFox _client;
// Use this for initialization
void Start() {
_client = new SmartFox();
_client.ThreadSafeMode = true;
_client.AddEventListener (SFSEvent.CONNECTION, OnConnection);
Connect();
}
// Update is called once per frame
void FixedUpdate() {
_client.ProcessEvents();
}
public void Connect(){
_client.Connect (host, port);
}
public void OnConnection(BaseEvent _event){
if ((bool)_event.Params ["success"]) {
Debug.Log("Successfully connected to server");
} else { Debug.Log("Failed to connect to server")
//failed
}
}
}
Я просто попробовал это, ту же ошибку, что и раньше. –