Пример #1
0
    // Token: 0x060003AE RID: 942 RVA: 0x000167D8 File Offset: 0x00014BD8
    private void AssignWeaponAnimation(int id)
    {
        ItemDataC        component  = this.database.GetComponent <ItemDataC>();
        PlayerAnimationC component2 = this.player.GetComponent <PlayerAnimationC>();

        if (!component2)
        {
            this.AssignMecanimAnimation(id);
            return;
        }
        if (component.equipment[id].attackCombo.Length > 0 && component.equipment[id].attackCombo[0] != null && component.equipment[id].EquipmentType == ItemDataC.Equip.EqType.Weapon)
        {
            int num = component.equipment[id].attackCombo.Length;
            this.player.GetComponent <AttackTriggerC>().attackCombo = new AnimationClip[num];
            int i = 0;
            if (num > 0)
            {
                while (i < num)
                {
                    this.player.GetComponent <AttackTriggerC>().attackCombo[i] = component.equipment[id].attackCombo[i];
                    this.player.GetComponent <AttackTriggerC>().mainModel.GetComponent <Animation>()[component.equipment[id].attackCombo[i].name].layer = 15;
                    i++;
                }
            }
            int whileAttack = (int)component.equipment[id].whileAttack;
            this.player.GetComponent <AttackTriggerC>().WhileAttackSet(whileAttack);
            this.player.GetComponent <AttackTriggerC>().attackSpeed = component.equipment[id].attackSpeed;
            this.player.GetComponent <AttackTriggerC>().atkDelay1   = component.equipment[id].attackDelay;
        }
        if (component.equipment[id].idleAnimation)
        {
            this.player.GetComponent <PlayerAnimationC>().idle = component.equipment[id].idleAnimation;
        }
        if (component.equipment[id].runAnimation)
        {
            component2.run = component.equipment[id].runAnimation;
        }
        if (component.equipment[id].rightAnimation)
        {
            component2.right = component.equipment[id].rightAnimation;
        }
        if (component.equipment[id].leftAnimation)
        {
            component2.left = component.equipment[id].leftAnimation;
        }
        if (component.equipment[id].backAnimation)
        {
            component2.back = component.equipment[id].backAnimation;
        }
        if (component.equipment[id].jumpAnimation)
        {
            this.player.GetComponent <PlayerAnimationC>().jump = component.equipment[id].jumpAnimation;
        }
        component2.AnimationSpeedSet();
    }
Пример #2
0
    void  AssignWeaponAnimation(int id)
    {
        ItemDataC        dataItem   = database.GetComponent <ItemDataC>();
        PlayerAnimationC playerAnim = player.GetComponent <PlayerAnimationC>();

        //Assign All Attack Combo Animation of the weapon from Database
        if (dataItem.equipment[id].attackCombo.Length > 0 && dataItem.equipment[id].attackCombo[0] != null && dataItem.equipment[id].EquipmentType == 0)
        {
            int allPrefab = dataItem.equipment[id].attackCombo.Length;
            player.GetComponent <AttackTriggerC>().attackCombo = new AnimationClip[allPrefab];

            int a = 0;
            if (allPrefab > 0)
            {
                while (a < allPrefab)
                {
                    player.GetComponent <AttackTriggerC>().attackCombo[a] = dataItem.equipment[id].attackCombo[a];
                    player.GetComponent <AttackTriggerC>().mainModel.animation[dataItem.equipment[id].attackCombo[a].name].layer = 15;
                    a++;
                }
            }
            int watk = (int)dataItem.equipment[id].whileAttack;
            player.GetComponent <AttackTriggerC>().WhileAttackSet(watk);
            //Assign Attack Speed
            player.GetComponent <AttackTriggerC>().attackSpeed = dataItem.equipment[id].attackSpeed;
            player.GetComponent <AttackTriggerC>().atkDelay1   = dataItem.equipment[id].attackDelay;
        }

        if (dataItem.equipment[id].idleAnimation)
        {
            player.GetComponent <PlayerAnimationC>().idle = dataItem.equipment[id].idleAnimation;
        }
        if (dataItem.equipment[id].runAnimation)
        {
            playerAnim.run = dataItem.equipment[id].runAnimation;
        }
        if (dataItem.equipment[id].rightAnimation)
        {
            playerAnim.right = dataItem.equipment[id].rightAnimation;
        }
        if (dataItem.equipment[id].leftAnimation)
        {
            playerAnim.left = dataItem.equipment[id].leftAnimation;
        }
        if (dataItem.equipment[id].backAnimation)
        {
            playerAnim.back = dataItem.equipment[id].backAnimation;
        }
        if (dataItem.equipment[id].jumpAnimation)
        {
            player.GetComponent <PlayerAnimationC>().jump = dataItem.equipment[id].jumpAnimation;
        }
        playerAnim.AnimationSpeedSet();
    }
Пример #3
0
    public void AssignWeaponAnimation(int id)
    {
        ItemDataC        dataItem   = database.GetComponent <ItemDataC>();
        PlayerAnimationC playerAnim = player.GetComponent <PlayerAnimationC>();

        if (!playerAnim)
        {
            //If use Mecanim
            AssignMecanimAnimation(id);
            return;
        }

        //Assign All Attack Combo Animation of the weapon from Database
        if (dataItem.equipment[id].attackCombo.Length > 0 && dataItem.equipment[id].attackCombo[0] && dataItem.equipment[id].EquipmentType == EqType.Weapon)
        {
            int allPrefab = dataItem.equipment[id].attackCombo.Length;
            player.GetComponent <AttackTriggerC>().attackCombo = new AnimationClip[allPrefab];
            player.GetComponent <AttackTriggerC>().c           = 0;

            int a = 0;
            if (allPrefab > 0)
            {
                while (a < allPrefab)
                {
                    player.GetComponent <AttackTriggerC>().attackCombo[a] = dataItem.equipment[id].attackCombo[a];
                    player.GetComponent <AttackTriggerC>().mainModel.GetComponent <Animation>()[dataItem.equipment[id].attackCombo[a].name].layer = 15;
                    a++;
                }
            }
            player.GetComponent <AttackTriggerC>().whileAttack = dataItem.equipment[id].whileAttack;
            //Assign Attack Speed
            player.GetComponent <AttackTriggerC>().attackSpeed = dataItem.equipment[id].attackSpeed;
            player.GetComponent <AttackTriggerC>().atkDelay1   = dataItem.equipment[id].attackDelay;
        }

        if (dataItem.equipment[id].idleAnimation)
        {
            player.GetComponent <PlayerAnimationC>().idle = dataItem.equipment[id].idleAnimation;
        }
        if (dataItem.equipment[id].runAnimation)
        {
            playerAnim.run = dataItem.equipment[id].runAnimation;
        }
        if (dataItem.equipment[id].rightAnimation)
        {
            playerAnim.right = dataItem.equipment[id].rightAnimation;
        }
        if (dataItem.equipment[id].leftAnimation)
        {
            playerAnim.left = dataItem.equipment[id].leftAnimation;
        }
        if (dataItem.equipment[id].backAnimation)
        {
            playerAnim.back = dataItem.equipment[id].backAnimation;
        }
        if (dataItem.equipment[id].jumpAnimation)
        {
            player.GetComponent <PlayerAnimationC>().jump = dataItem.equipment[id].jumpAnimation;
        }
        playerAnim.AnimationSpeedSet();
    }