fix upgrades
This commit is contained in:
parent
d8c49317a3
commit
5dcbd3c313
17 changed files with 477 additions and 83 deletions
|
|
@ -5,21 +5,20 @@ public class AbilityUpgrade : ScriptableObject
|
|||
[Header("Identification")]
|
||||
public string upgradeName;
|
||||
public Sprite upgradeIcon;
|
||||
public PlayerAbility thisPlayerAbility;
|
||||
[Header("Stats")]
|
||||
public int count = 1;
|
||||
public PlayerAbility thisPlayerAbility;
|
||||
|
||||
public virtual void ApplyUpgrade()
|
||||
public void ApplyUpgrade(PlayerAbility abilityToUpgrade)
|
||||
{
|
||||
UpgradeEffects();
|
||||
UpgradeEffects(abilityToUpgrade);
|
||||
}
|
||||
|
||||
protected virtual void UpgradeEffects()
|
||||
protected virtual void UpgradeEffects(PlayerAbility abilityToUpgrade)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public virtual void ApplyRemoval()
|
||||
public virtual void ApplyRemoval(PlayerAbility abilityToRemove)
|
||||
{
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,9 +4,8 @@ public class AttackSpeedUpgrade : AbilityUpgrade
|
|||
{
|
||||
[SerializeField] private float speedUpgradeAmount;
|
||||
|
||||
public override void ApplyUpgrade()
|
||||
protected override void UpgradeEffects(PlayerAbility abilityToUpgrade)
|
||||
{
|
||||
base.ApplyUpgrade();
|
||||
thisPlayerAbility.cooldown *= speedUpgradeAmount;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@ using UnityEngine;
|
|||
[CreateAssetMenu(fileName = "Projectile Count Upgrade", menuName = "AbilityUpgrades/ProjectileCountUpgrade")]
|
||||
public class ProjectileCountUpgrade : AbilityUpgrade
|
||||
{
|
||||
protected override void UpgradeEffects()
|
||||
protected override void UpgradeEffects(PlayerAbility abilityToUpgrade)
|
||||
{
|
||||
thisPlayerAbility.projectileCount++; //idk how this will work for the stacking.
|
||||
abilityToUpgrade.projectileCount++; //idk how this will work for the stacking.
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,12 +17,11 @@ public class UpgradeBoxUI : MonoBehaviour, IDropHandler
|
|||
return;
|
||||
}
|
||||
counterUI.gameObject.SetActive(true);
|
||||
counterUI.text = $"x{thisAbilityUpgrade.count}";
|
||||
counterUI.text = $"x{thisPlayerAbility.attachedUpgrades[thisAbilityUpgrade]}";
|
||||
}
|
||||
|
||||
public void OnDrop(PointerEventData eventData)
|
||||
{
|
||||
Debug.Log("A");
|
||||
if (eventData.pointerDrag.TryGetComponent(out StoredAbilityUpgradeUI isStoredUpgrade) && (!thisAbilityUpgrade || isStoredUpgrade.storedUpgrade == thisAbilityUpgrade))
|
||||
{
|
||||
thisAbilityUpgrade = isStoredUpgrade.storedUpgrade;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue