public virtual void Init(FSClient client) { this.client = client; Input.framUpdate += DataFrameUpdate; comList = new List <ComponentBase>(); rigibody = new PhysicsComponent(); rigibody.Init(OnPhysicsCheckEnter, OnPhysicsCheckStay, OnPhysicsCheckExit); transform = new TransformComponent(); transform.Init(this); Debug.Log(name + "init"); }
/// <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(); _m_inputs[i].Init(); } }
public NetObjectManager(FSClient fsClient) { client = fsClient; }