public static MEquipment Create(App.Model.Master.MNpcEquipment npcEquipment) { MEquipment equipment = new MEquipment(); equipment.Id = npcEquipment.id; equipment.EquipmentId = npcEquipment.equipment_id; equipment.EquipmentType = npcEquipment.equipment_type; equipment.Level = npcEquipment.level; return(equipment); }
private IEnumerator EquipmentChange(int id) { yield return(StartCoroutine(sEquipment.RequestEquip(character.CharacterId, id))); App.Model.MEquipment mEquipment = System.Array.Find(Global.SUser.self.equipments, _ => _.Id == id); Global.SUser.self.equipments = sEquipment.equipments; if (mEquipment.EquipmentType == App.Model.Master.MEquipment.EquipmentType.weapon) { character.Weapon = mEquipment.EquipmentId; } else if (mEquipment.EquipmentType == App.Model.Master.MEquipment.EquipmentType.clothes) { character.Clothes = mEquipment.EquipmentId; } else if (mEquipment.EquipmentType == App.Model.Master.MEquipment.EquipmentType.horse) { character.Horse = mEquipment.EquipmentId; } character.StatusInit(); }