void ProcessRenderMessage_StartMoving(LocomoteRenderMessage msg) { RenderEntity render_entity = m_render_entity_manager.GetObject(msg.EntityID); if (render_entity == null) { return; } ModelComponent model_component = render_entity.GetComponent(ModelComponent.ID) as ModelComponent; if (model_component == null) { return; } m_render_world.RegisterMovingEntity(model_component); PredictLogicComponent predic_component = render_entity.GetComponent(PredictLogicComponent.ID) as PredictLogicComponent; if (msg.m_reason == LocomoteRenderMessage.NotLocomotion || msg.m_block_animation) { model_component.UpdateAngle(); if (predic_component != null) { predic_component.OnLogicMove(); } } else if (msg.m_reason == LocomoteRenderMessage.NotFromCommand) { model_component.UpdateAngle(); PlayLocomotorAnimation(render_entity); if (predic_component != null) { predic_component.OnLogicMove(); } } else if (msg.m_reason == LocomoteRenderMessage.UnblockAnimation) { model_component.UpdateAngle(); PlayLocomotorAnimation(render_entity); } else if (predic_component == null || !predic_component.HasMovementPredict) { model_component.UpdateAngle(); PlayLocomotorAnimation(render_entity); } }
void ProcessRenderMessage_ChangeDirection(ChangeDirectionRenderMessage msg) { //ZZWTODO 移动动作和朝向 RenderEntity render_entity = m_render_entity_manager.GetObject(msg.EntityID); if (render_entity == null) { return; } PredictLogicComponent predic_component = render_entity.GetComponent(PredictLogicComponent.ID) as PredictLogicComponent; if (predic_component != null && predic_component.HasMovementPredict) { return; } ModelComponent model_component = render_entity.GetComponent(ModelComponent.ID) as ModelComponent; if (model_component == null) { return; } model_component.UpdateAngle(); }