private void ReadBorn(XmlElement xml) { XmlNodeList bornList = XmlRead.GetList(xml, "born_pos"); m_dicBornData.Clear(); foreach (XmlNode node in bornList) { XmlElement ele = node as XmlElement; BornData pBorn = DataBase.CreateInstance <BornData>(); pBorn.FromXml(ele); int team = 0; XmlRead.Attr(ele, "team", ref team); if (m_dicBornData.ContainsKey(team)) { m_dicBornData[team].Add(pBorn); } else { m_dicBornData[team] = new List <BornData>() { pBorn }; } } }
public override void FromXml(XmlElement xml) { XmlRead.Attr(xml, "config_id", ref config_id); XmlRead.Attr(xml, "resource_id", ref m_iResourceID); XmlRead.Attr(xml, "shape_path", ref m_strShapePath); XmlRead.Attr(xml, "border_path", ref m_strBorderPath); XmlRead.Attr(xml, "mass", ref m_fMass); XmlRead.Attr(xml, "g_factor", ref m_fGFactor); XmlRead.Attr(xml, "wind_factor", ref m_fWindFactor); XmlRead.Attr(xml, "air_resit_factor", ref m_fAirResitFactor); float attack_box_min_x = 0; XmlRead.Attr(xml, "attack_box_min_x", ref attack_box_min_x); m_pAttackRect.xMin = attack_box_min_x; float attack_box_min_y = 0; XmlRead.Attr(xml, "attack_box_min_y", ref attack_box_min_y); m_pAttackRect.yMin = attack_box_min_y; float attack_box_max_x = 0; XmlRead.Attr(xml, "attack_box_max_x", ref attack_box_max_x); m_pAttackRect.xMax = attack_box_max_x; float attack_box_max_y = 0; XmlRead.Attr(xml, "attack_box_max_y", ref attack_box_max_y); m_pAttackRect.yMax = attack_box_max_y; XmlRead.Attr(xml, "bomb_range", ref m_fBombRange); }
override public void FromXml(XmlElement xml) { XmlRead.Attr(xml, "bound_left", ref bound_left); XmlRead.Attr(xml, "bound_top", ref bound_top); XmlRead.Attr(xml, "bound_right", ref bound_right); XmlRead.Attr(xml, "bound_bottom", ref bound_bottom); XmlRead.Attr(xml, "gravity", ref gravity); XmlRead.Attr(xml, "air_resistance", ref air_resistance); XmlRead.Attr(xml, "wind_range", ref wind_range); XmlRead.Attr(xml, "wind_step", ref wind_step); XmlRead.Attr(xml, "camera_margin_x", ref camera_margin_x); XmlRead.Attr(xml, "camera_margin_y", ref camera_margin_y); XmlRead.Attr(xml, "camera_smooth_x", ref camera_smooth_x); XmlRead.Attr(xml, "camera_smooth_y", ref camera_smooth_y); XmlRead.Attr(xml, "camera_min_x", ref camera_min_x); XmlRead.Attr(xml, "camera_min_y", ref camera_min_y); XmlRead.Attr(xml, "camera_max_x", ref camera_max_x); XmlRead.Attr(xml, "camera_max_y", ref camera_max_y); ReadBorn(xml); ReadMapCell(xml, "background", m_listBG); ReadMapCell(xml, "terrain", m_listTerrain); }
public override void FromXml(XmlElement xml) { XmlRead.Attr(xml, "resource", ref resource); XmlRead.Attr(xml, "pos_x", ref pos_x); XmlRead.Attr(xml, "pos_y", ref pos_y); XmlRead.Attr(xml, "digable", ref digable); XmlRead.Attr(xml, "width", ref Width); XmlRead.Attr(xml, "height", ref Height); }
override public void FromXml(System.Xml.XmlElement xml) { try { XmlRead.Attr(xml, "pos_x", ref pos_x); XmlRead.Attr(xml, "pos_y", ref pos_y); XmlRead.Attr(xml, "face", ref face); } catch (Exception e) { LOG.Error(e.Message); } }
public override void FromXml(XmlElement xml) { XmlRead.Attr(xml, "id", ref id); XmlRead.Attr(xml, "default_name", ref default_name); XmlRead.Attr(xml, "description", ref description); XmlRead.Attr(xml, "damage", ref damage); XmlRead.Attr(xml, "center_damage", ref center_damage); XmlRead.Attr(xml, "cd", ref cd); XmlRead.Attr(xml, "energy", ref energy); XmlRead.Attr(xml, "index", ref index); XmlRead.Attr(xml, "image_resource", ref image_resource); XmlRead.Attr(xml, "fly_voice_resource", ref fly_voice_resource); XmlRead.Attr(xml, "bomb_voice_resource", ref bomb_voice_resource); }
public override void FromXml(XmlElement xml) { XmlRead.Attr(xml, "id", ref id); XmlRead.Attr(xml, "default_name", ref default_name); XmlRead.Attr(xml, "description", ref description); XmlRead.Attr(xml, "resource_id", ref resource_id); XmlRead.Attr(xml, "scale", ref scale); XmlRead.Attr(xml, "walk_speed_x", ref walk_speed_x); XmlRead.Attr(xml, "walk_speed_y", ref walk_speed_y); XmlRead.Attr(xml, "low_fire_angle", ref low_fire_angle); XmlRead.Attr(xml, "high_fire_angle", ref high_fire_angle); XmlRead.Attr(xml, "fire_range", ref fire_range); int weapon_pos_x = 0; XmlRead.Attr(xml, "weapon_pos_x", ref weapon_pos_x); int weapon_pos_y = 0; XmlRead.Attr(xml, "weapon_pos_y", ref weapon_pos_y); WeaponPosition = new Vector2(weapon_pos_x, weapon_pos_y); XmlRead.Attr(xml, "be_attack_box_min_x", ref be_attack_box_min_x); XmlRead.Attr(xml, "be_attack_box_min_y", ref be_attack_box_min_y); XmlRead.Attr(xml, "be_attack_box_max_x", ref be_attack_box_max_x); XmlRead.Attr(xml, "be_attack_box_max_y", ref be_attack_box_max_y); XmlRead.Attr(xml, "self_skill", ref self_skill); XmlRead.Attr(xml, "m_iHP", ref m_iHP); XmlRead.Attr(xml, "m_iMoveEnergy", ref m_iMoveEnergy); XmlRead.Attr(xml, "m_iAddEnergy", ref m_iAddEnergy); XmlNodeList xmlList = xml.GetElementsByTagName("state"); foreach (XmlNode node in xmlList) { XmlElement ele = node as XmlElement; CharacterStateData pData = DataBase.CreateInstance <CharacterStateData>(); pData.FromXml(ele); CharacterStateType eType = CharacterStateType.UNDEFINE; XmlRead.AttrEnum <CharacterStateType>(ele, "state_type", ref eType); if (Actions.ContainsKey(eType)) { LOG.Error("repeat state[" + eType.ToString() + "] in same instruction[" + id + "]"); } else { Actions[eType] = pData; } } }
public override void FromXml(XmlElement xml) { XmlRead.Attr(xml, "animation_name", ref animation_name); XmlRead.Attr(xml, "total_frame", ref total_frame); XmlNodeList xmlList = xml.GetElementsByTagName("attack"); int frame = -1; foreach (XmlNode node in xmlList) { XmlElement ele = node as XmlElement; CharacterAttackType eType = CharacterAttackType.NONE; XmlRead.AttrEnum <CharacterAttackType>(ele, "attack_type", ref eType); XmlRead.Attr(ele, "frame_index", ref frame); AttackBaseData pData = AttackBaseData.CreateInstance(eType); pData.FromXml(ele); AttackData[frame] = pData; Network.attackbasedata = pData; } }
private void LoadBombData() { string path = Application.dataPath; Object obj = Resources.Load("Config/bomb_data"); string f = obj.ToString(); XmlDocument doc = new XmlDocument(); doc.LoadXml(f); XmlElement root = doc.DocumentElement; XmlNodeList xmlList = root.GetElementsByTagName("bomb"); foreach (XmlNode node in xmlList) { XmlElement ele = node as XmlElement; int id = 0; XmlRead.Attr(ele, "", ref id); BombData pData = DataBase.CreateInstance <BombData>(); pData.FromXml(ele); m_dicBombData[pData.config_id] = pData; } }
public override void FromXml(XmlElement xml) { XmlRead.Attr(xml, "bomb_config_id", ref bomb_config_id); XmlRead.Attr(xml, "damage", ref damage); XmlRead.Attr(xml, "center_damage", ref center_damage); }
public override void FromXml(XmlElement xml) { XmlRead.Attr(xml, "level", ref level); XmlRead.Attr(xml, "exp", ref needExp); }
public override void FromXml(XmlElement xml) { XmlRead.Attr(xml, "id", ref chat_id); XmlRead.Attr(xml, "text", ref chat_text); }
public override void FromXml(XmlElement xml) { XmlRead.Attr(xml, "id", ref image_id); XmlRead.Attr(xml, "source_", ref image_source); XmlRead.Attr(xml, "text", ref image_name); }
public override void FromXml(XmlElement xml) { XmlRead.Attr(xml, "name", ref Character_name); }