public virtual void Init(FSClient client, int clientid = -1) { this.client = client; client.inputCenter.frameUpdate += DataFrameUpdate; this.clientId = clientid; Input = client.inputCenter[this.clientId]; comList = new List <ComponentBase>(); rigibody = new PhysicsComponent(); rigibody.Init(OnPhysicsCheckEnter, OnPhysicsCheckStay, OnPhysicsCheckExit); rigibody.netdata = this; transform = new TransformComponent(); transform.Init(this); }
/// <summary> /// 初始化 /// </summary> /// <param name="client">帧同步客户端对象</param> /// <param name="maxClient">最大客户端数</param> public void Init(FSClient client, int maxClient) { this.client = client; timer = new Timer(FSClient.deltaTime.ToFloat() * 1000); timer.AutoReset = true; timer.Elapsed += SendClientFrame; timer.Enabled = true; _m_serverStep = 0; _m_clientStep = 0; _m_inputs = new InputUnit[maxClient + 1]; joySticks = new Dictionary <KeyNum, JoyStickKey>(); sendKey = new FrameKey(); for (int i = 0; i < maxClient + 1; i++) { _m_inputs[i] = new InputUnit(this); } }
public NetObjectManager(FSClient client) { this.client = client; }