internal static void Execute(object msg, NetConnection conn) { Msg_RC_NpcFace face_msg = msg as Msg_RC_NpcFace; if (null == face_msg) { return; } EntityInfo npc = PluginFramework.Instance.GetEntityById(face_msg.npc_id); if (npc == null) { return; } if (npc.HaveState(CharacterPropertyEnum.x3002_昏睡)) { return; } float dir = ProtoHelper.DecodeFloat(face_msg.face_direction); npc.GetMovementStateInfo().SetFaceDir(dir); UnityEngine.GameObject actor = EntityController.Instance.GetGameObject(npc.GetId()); actor.transform.localRotation = UnityEngine.Quaternion.Euler(0, Utility.RadianToDegree(dir), 0); }
public static Msg_RC_NpcFace BuildNpcFaceMessage(EntityInfo npc) { Msg_RC_NpcFace npcFaceBuilder = new Msg_RC_NpcFace(); npcFaceBuilder.npc_id = npc.GetId(); npcFaceBuilder.face_direction = npc.GetMovementStateInfo().GetFaceDir(); return(npcFaceBuilder); }
internal static Msg_RC_NpcFace BuildNpcFaceMessage(NpcInfo npc) { Msg_RC_NpcFace npcFaceBuilder = new Msg_RC_NpcFace(); npcFaceBuilder.npc_id = npc.GetId(); npcFaceBuilder.face_direction = (float)npc.GetMovementStateInfo().GetFaceDir(); return(npcFaceBuilder); }
internal static Msg_RC_NpcFace BuildNpcFaceMessage(EntityInfo npc) { Msg_RC_NpcFace npcFaceBuilder = new Msg_RC_NpcFace(); npcFaceBuilder.npc_id = npc.GetId(); npcFaceBuilder.face_direction = ProtoHelper.EncodeFloat(npc.GetMovementStateInfo().GetFaceDir()); return(npcFaceBuilder); }
internal static void Execute(object msg, NetConnection conn, NetworkSystem networkSystem) { Msg_RC_NpcFace face_msg = msg as Msg_RC_NpcFace; if (null == face_msg) { return; } }
private void OnNpcFace(NpcInfo npc) { Scene scene = npc.SceneContext.CustomData as Scene; if (null != scene) { Msg_RC_NpcFace npcFaceBuilder = DataSyncUtility.BuildNpcFaceMessage(npc); if (null != npcFaceBuilder) { scene.NotifyAreaUser(npc, npcFaceBuilder); } } }
private void OnAiFace(EntityInfo npc) { if (npc.GetMovementStateInfo().IsFaceDirChanged) { npc.GetMovementStateInfo().IsFaceDirChanged = false; if (null != npc) { float dir = npc.GetMovementStateInfo().GetFaceDir(); npc.GetMovementStateInfo().SetFaceDir(dir); } if (!npc.GetMovementStateInfo().IsMoving) { Scene scene = npc.SceneContext.CustomData as Scene; if (null != scene) { Msg_RC_NpcFace npcFaceBuilder = DataSyncUtility.BuildNpcFaceMessage(npc); if (null != npcFaceBuilder) { scene.NotifyAllUser(RoomMessageDefine.Msg_RC_NpcFace, npcFaceBuilder); } } } } }