Example #1
0
    public void AttachWeapon()
    {
        foreach (GameObject oldObjects in weaponObjects)
        {
            Destroy(oldObjects);
        }
        foreach (ObjectAndAttachment oAndA in playerMain.GetWeapon().objectAndAttachments)
        {
            GameObject temp = (GameObject)GameObject.Instantiate(oAndA.objectPrefab);
            temp.GetComponent <Renderer>().material.color = playerMain.GetWeaponInst().GetHalfQualityColor();
            weaponObjects.Add(temp);

            temp.GetComponent <Renderer>().material.color = playerMain.GetWeaponInst().GetHalfQualityColor();
            foreach (Transform t in attachmentPoints)
            {
                if (string.Equals(t.name, "_" + oAndA.attachmentNameHold))
                {
                    temp.transform.parent = t;
                }
                temp.transform.localPosition = Vector3.zero;
                temp.transform.localRotation = Quaternion.Euler(0, 0, 90);
            }
            weaponObjects.Add(temp);
        }
        //weapon.SetupHurtbox(weaponObjects [0].GetComponent<HurtBox>());
    }
Example #2
0
 public void UpdateAbilityIconFromItem(ItemType itemType)
 {
     if (itemType == ItemType.weapon)
     {
         abilityIcons[0].UpdateIcon(playerMain.GetWeapon().action);
     }
     if (itemType == ItemType.armor)
     {
         abilityIcons[1].UpdateIcon(playerMain.GetArmor().action);
     }
     if (itemType == ItemType.artifact)
     {
         abilityIcons[2].UpdateIcon(playerMain.GetArtifact().action);
     }
 }
Example #3
0
    public void SetWeaponBasicAttackSpeed()
    {
        float attackSpeed = playerMain.GetWeapon().GetRealSpeed(playerMain.GetWeaponInst().quality);

        weaponBasicAttack.maxCooldown = attackSpeed;
    }