void OtherCommandLogic(EntityBase entity) { AddComp(entity); PlayerCommandRecordComponent rc = entity.GetComp <PlayerCommandRecordComponent>(); //先取服务器缓存 T cmd = (T)rc.GetInputCahae(m_world.FrameCount); //没有的话预测一份 if (cmd == null) { cmd = (T)rc.GetForecastInput(m_world.FrameCount); } rc.RecordCommand(cmd); entity.ChangeComp(cmd); }
void OtherCommandLogic(EntityBase entity) { //Debug.Log("OtherCommandLogic " + m_world.FrameCount); AddComp(entity); PlayerCommandRecordComponent rc = entity.GetComp <PlayerCommandRecordComponent>(); //先取服务器缓存 T cmd = (T)rc.GetInputCahae(m_world.FrameCount); //没有的话预测一份 if (cmd == null) { //Debug.Log("预测本地操作 " + m_world.FrameCount + " id " + entity.ID); cmd = (T)rc.GetForecastInput(m_world.FrameCount); } rc.RecordCommand(cmd); entity.ChangeComp(cmd); //Debug.Log("Other cmd " + entity.ID + " content " + Serializer.Serialize(cmd) + " " + m_world.FrameCount); }