public static GameObjInfo Player(Character player) //转换成玩家 { GameObjInfo ret = new GameObjInfo(); ret.GameObjType = Communication.Proto.GameObjType.Character; Basic(player, ref ret); ret.TeamID = player.TeamID; ret.Ap = player.AP; ret.BulletType = ConvertTool.ToCommunicationBulletType(player.bulletType); Prop?holdProp = player.HoldProp; // 防止判断后被突然置null ret.PropType = holdProp == null ? Communication.Proto.PropType.Null : ConvertTool.ToCommunicationPropType(holdProp.GetPropType()); ret.IsDying = player.IsResetting; ret.JobType = ConvertTool.ToCommunicationJobType(player.jobType); ret.CD = player.CD; ret.MaxBulletNum = player.MaxBulletNum; ret.BulletNum = player.BulletNum; ret.MaxHp = player.MaxHp; ret.Hp = player.HP; ret.LifeNum = player.LifeNum; return(ret); }
public static GameObjInfo Prop(Prop prop) //转换成道具 { GameObjInfo ret = new GameObjInfo(); ret.GameObjType = Communication.Proto.GameObjType.Prop; Basic(prop, ref ret); ret.PropType = ConvertTool.ToCommunicationPropType(prop.GetPropType()); ret.IsLaid = prop.Laid; return(ret); }
public static GameObjInfo Prop(Prop prop) //转换成道具 { GameObjInfo ret = new GameObjInfo(); ret.GameObjType = Communication.Proto.GameObjType.Prop; Basic(prop, ref ret); ret.PropType = ConvertTool.ToCommunicationPropType(prop.GetPropType()); ret.IsLaid = prop.Laid; ret.TeamID = prop.Parent == null ? Team.invalidTeamID : prop.Parent.TeamID; return(ret); }