Ejemplo n.º 1
0
    public void EquipArmor(Armor armor)
    {
        armor.Remove();


        if (equippedArmor != null)
        {
            if (equippedArmor != armor)
            {
                armor.MySlot.AddItem(equippedArmor);
            }

            UIManager.MyInstance.RefreashTooltip(equippedArmor);
        }
        else
        {
            UIManager.MyInstance.HideTooltip();
        }

        icon.enabled       = true;
        icon.sprite        = armor.MyIcon;
        icon.color         = Color.white;
        this.equippedArmor = armor;// a reference to the equipped armor
        this.equippedArmor.MyCharButton = this;

        if (HandScript.MyInstance.MyMoveable == (armor as IMoveable))
        {
            HandScript.MyInstance.Drop();
        }
        if (gearSocket != null && equippedArmor.MyAnimationClips != null)
        {
            gearSocket.Equip(equippedArmor.MyAnimationClips);
        }
    }
Ejemplo n.º 2
0
    public void EquipArmor(Armor armor)
    {
        armor.Remove();

        if (equippedArmor != null)
        {
            if (equippedArmor != armor)
            {
                //替换装备,也替换提示框
                armor.MySlot.AddItem(equippedArmor);
                UIManager.MyInstance.RefreshTooltip(equippedArmor);
            }
        }
        else
        {
            //装备的时候隐藏提示框
            UIManager.MyInstance.HideTooltip();
        }

        icon.enabled  = true;
        icon.sprite   = armor.MyIcon;
        icon.color    = Color.white;
        equippedArmor = armor;
        equippedArmor.MyCharButton = this;

        if (HandScript.MyInstance.MyMoveable == (armor as IMoveable))
        {
            HandScript.MyInstance.Drop();
        }

        if (gearSocket != null && equippedArmor.MyAnimationClips != null)
        {
            gearSocket.Equip(equippedArmor.MyAnimationClips);
        }
    }
Ejemplo n.º 3
0
    public void SetPlayerShoes(int shoesId, Color shoesColor)
    {
        AnimGroup  animGroup  = Resources.Load <AnimGroup>("Animations" + SLASH + "Groupings" + SLASH + "Shoes" + SLASH + shoesId);
        GearSocket gearSocket = GetGearSocketWithName("Shoes");

        if (gearSocket != null && ShowPlayerEquipment())
        {
            gearSocket.Equip(animGroup, m_attackType, shoesColor);
        }
    }
Ejemplo n.º 4
0
    public void SetPlayerWeapon(int weaponId, Color weaponColor)
    {
        AnimGroup  animGroup  = Resources.Load <AnimGroup>("Animations" + SLASH + "Groupings" + SLASH + "Weapon" + SLASH + weaponId);
        GearSocket gearSocket = GetGearSocketWithName("Weapon");

        if (gearSocket != null && ShowPlayerEquipment())
        {
            gearSocket.Equip(animGroup, m_attackType, weaponColor);
        }
    }
Ejemplo n.º 5
0
    public void SetPlayerPants(int pantsId, Color pantsColor)
    {
        AnimGroup  animGroup  = Resources.Load <AnimGroup>("Animations" + SLASH + "Groupings" + SLASH + "Bottom" + SLASH + pantsId);
        GearSocket gearSocket = GetGearSocketWithName("Bottom");

        if (gearSocket != null && ShowPlayerEquipment())
        {
            gearSocket.Equip(animGroup, m_attackType, pantsColor);
        }
    }
Ejemplo n.º 6
0
    public void SetPlayerChest(int chestId, Color chestColor)
    {
        AnimGroup  animGroup  = Resources.Load <AnimGroup>("Animations" + SLASH + "Groupings" + SLASH + "Top" + SLASH + chestId);
        GearSocket gearSocket = GetGearSocketWithName("Top");

        if (gearSocket != null && ShowPlayerEquipment())
        {
            gearSocket.Equip(animGroup, m_attackType, chestColor);
        }
    }
Ejemplo n.º 7
0
    public void SetPlayerHelm(int helmId, Color helmColor)
    {
        AnimGroup  animGroup  = Resources.Load <AnimGroup>("Animations" + SLASH + "Groupings" + SLASH + "Helm" + SLASH + helmId);
        GearSocket gearSocket = GetGearSocketWithName("Helm");

        if (gearSocket != null && ShowPlayerEquipment())
        {
            gearSocket.Equip(animGroup, m_attackType, helmColor);
        }
    }
Ejemplo n.º 8
0
    public void SetPlayerFace(int faceId)
    {
        AnimGroup  animGroup  = Resources.Load <AnimGroup>("Animations" + SLASH + "Groupings" + SLASH + "Face" + SLASH + faceId);
        GearSocket gearSocket = GetGearSocketWithName("Face");

        if (gearSocket != null && ShowPlayerEquipment())
        {
            gearSocket.Equip(animGroup, m_attackType);
        }
    }
Ejemplo n.º 9
0
    public void EquipArmor(Armor armor)
    {
        armor.Remove();

        if (visual != null)
        {
            visual.gameObject.SetActive(true);
            visual.sprite = armor.Visual;
        }

        if (MyEquippedArmor != null)
        {
            Player.MyInstance.DequipGear(MyEquippedArmor);

            if (MyEquippedArmor != armor)
            {
                armor.MySlot.AddItem(MyEquippedArmor);
            }

            UIManager.MyInstance.RefreshTooltip(MyEquippedArmor);
        }
        else
        {
            UIManager.MyInstance.HideTooltip();
        }

        icon.enabled       = true;
        icon.sprite        = armor.MyIcon;
        icon.color         = Color.white;
        this.equippedArmor = armor; //A reference to the equipped armor
        this.MyEquippedArmor.MyCharButton = this;

        if (HandScript.MyInstance.MyMoveable == (armor as IMoveable))
        {
            HandScript.MyInstance.Drop();
        }

        if (gearSocket != null && MyEquippedArmor.MyAnimationClips != null)
        {
            gearSocket.Equip(MyEquippedArmor.MyAnimationClips);
        }

        Player.MyInstance.EquipGear(armor);
    }
Ejemplo n.º 10
0
    public void SetPlayerBody(int bodyId)
    {
        AnimGroup animGroup = Resources.Load <AnimGroup>("Animations" + SLASH + "Groupings" + SLASH + "Body" + SLASH + bodyId);

        if (animGroup != null)
        {
            m_spriteHeight = animGroup.GetSpriteHeight();
            m_spriteWidth  = animGroup.GetSpriteWidth();
            UpdatePlayerNamePosition(m_spriteHeight);
            UpdateStatBarSize();
            UpdateSpellTargetSize();
            m_bodyId = bodyId;
            if (!ShowPlayerEquipment())
            {
                SetPlayerPoseEnum(AnimAttackType.Fist);
                ClearPlayerAppearance();
            }
            GearSocket gearSocket = GetGearSocketWithName("Body");
            if (gearSocket != null)
            {
                gearSocket.Equip(animGroup, m_attackType);
            }
        }
    }