Esempio n. 1
0
        private void WeaponChanged()
        {
            int weaponId = mCharacter.weapon;

            Model.Equipment.MEquipment mEquipment = mCharacter.equipmentWepon;
            if (mEquipment.equipmentId == 0)
            {
                weapon.gameObject.SetActive(false);
                weaponRight.gameObject.SetActive(false);
                weaponArchery.gameObject.SetActive(false);
                return;
            }
            bool isArchery = (mEquipment.weaponType == WeaponType.archery);

            weapon.gameObject.SetActive(!isArchery);
            weaponArchery.gameObject.SetActive(isArchery);
            if (mEquipment.weaponType == WeaponType.dualWield)
            {
                this.Weapon.spriteMesh      = ImageAssetBundleManager.GetLeftWeaponMesh(mEquipment.equipmentId);
                this.weaponRight.spriteMesh = ImageAssetBundleManager.GetRightWeaponMesh(mEquipment.equipmentId);
            }
            else
            {
                this.Weapon.spriteMesh = ImageAssetBundleManager.GetWeaponMesh(mEquipment.equipmentId);
            }
        }
Esempio n. 2
0
        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);
            }
        }