private void HorseChanged(int oldvalue, int newvalue) { App.Model.Master.MEquipment mEquipment = null; if (newvalue == 0) { App.Model.Master.MCharacter character = CharacterCacher.Instance.Get(ViewModel.CharacterId.Value); mEquipment = EquipmentCacher.Instance.GetEquipment(character.horse, App.Model.Master.MEquipment.EquipmentType.horse); newvalue = character.horse; } else { mEquipment = EquipmentCacher.Instance.GetEquipment(newvalue, MEquipment.EquipmentType.horse); } if (mEquipment.move_type == App.Model.MoveType.cavalry) { horseBody.spriteMesh = ImageAssetBundleManager.GetHorseBodyMesh(mEquipment.image_index); horseFrontLegLeft.spriteMesh = ImageAssetBundleManager.GetHorseFrontLegLeftMesh(mEquipment.image_index); horseFrontLegRight.spriteMesh = ImageAssetBundleManager.GetHorseFrontLegRightMesh(mEquipment.image_index); horseHindLegLeft.spriteMesh = ImageAssetBundleManager.GetHorseHindLegLeftMesh(mEquipment.image_index); horseHindLegRight.spriteMesh = ImageAssetBundleManager.GetHorseHindLegRightMesh(mEquipment.image_index); horseSaddle.spriteMesh = ImageAssetBundleManager.GetHorseSaddleMesh(mEquipment.saddle); legLeft.spriteMesh = ImageAssetBundleManager.GetShoeLeftMesh(App.Util.Global.Constant.shoe_default_index); legRight.spriteMesh = ImageAssetBundleManager.GetShoeRightMesh(App.Util.Global.Constant.shoe_default_index); } else { legLeft.spriteMesh = ImageAssetBundleManager.GetShoeLeftMesh(mEquipment.image_index); legRight.spriteMesh = ImageAssetBundleManager.GetShoeRightMesh(mEquipment.image_index); } }
private void ClothesChanged(int oldvalue, int newvalue) { App.Model.Master.MEquipment mEquipment = null; if (newvalue == 0) { App.Model.Master.MCharacter character = CharacterCacher.Instance.Get(ViewModel.CharacterId.Value); mEquipment = EquipmentCacher.Instance.GetEquipment(character.clothes, App.Model.Master.MEquipment.EquipmentType.clothes); newvalue = character.clothes; } else { mEquipment = EquipmentCacher.Instance.GetEquipment(newvalue, MEquipment.EquipmentType.clothes); } bool isArmor = (mEquipment.clothes_type == MEquipment.ClothesType.armor); clothesUpShort.gameObject.SetActive(isArmor); clothesDownShort.gameObject.SetActive(isArmor); armLeftShort.gameObject.SetActive(isArmor); armRightShort.gameObject.SetActive(isArmor); clothesUpLong.gameObject.SetActive(!isArmor); clothesDownLong.gameObject.SetActive(!isArmor); armLeftLong.gameObject.SetActive(!isArmor); armRightLong.gameObject.SetActive(!isArmor); ClothesUp.spriteMesh = ImageAssetBundleManager.GetClothesUpMesh(newvalue); ClothesDown.spriteMesh = ImageAssetBundleManager.GetClothesDownMesh(newvalue); }
private void WeaponChanged(int oldvalue, int newvalue) { App.Model.Master.MEquipment mEquipment = null; if (newvalue == 0) { App.Model.Master.MCharacter character = CharacterCacher.Instance.Get(ViewModel.CharacterId.Value); mEquipment = EquipmentCacher.Instance.GetEquipment(character.weapon, App.Model.Master.MEquipment.EquipmentType.weapon); newvalue = character.weapon; } else { mEquipment = EquipmentCacher.Instance.GetEquipment(newvalue, MEquipment.EquipmentType.weapon); } if (mEquipment == null) { weapon.gameObject.SetActive(false); weaponRight.gameObject.SetActive(false); weaponArchery.gameObject.SetActive(false); return; } bool isArchery = (mEquipment.weapon_type == App.Model.WeaponType.archery); weapon.gameObject.SetActive(!isArchery); weaponArchery.gameObject.SetActive(isArchery); if (mEquipment.weapon_type == App.Model.WeaponType.dualWield) { //this.weaponRight.gameObject.SetActive(true); this.Weapon.spriteMesh = ImageAssetBundleManager.GetLeftWeaponMesh(newvalue); this.weaponRight.spriteMesh = ImageAssetBundleManager.GetRightWeaponMesh(newvalue); } else { //this.weaponRight.gameObject.SetActive(false); this.Weapon.spriteMesh = ImageAssetBundleManager.GetWeaponMesh(newvalue); } }