1
Fork 0
slime-blood-and-pain/Assets/Scripts/EntityItemShopSword.cs

23 lines
672 B
C#
Raw Normal View History

2019-04-29 08:39:48 +00:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class EntityItemShopSword : EntityItemShop {
public float damage = 3f;
2019-04-29 17:53:45 +00:00
public GameObject attackAnimation;
2019-04-29 08:39:48 +00:00
public override string Name {
get {
2019-04-29 17:53:45 +00:00
return "Sword (" + damage.ToString("0.0") + " atk)";
2019-04-29 08:39:48 +00:00
}
}
2019-04-29 13:27:26 +00:00
protected override void OnPurchase(EntityPlayer player) {
2019-04-29 08:39:48 +00:00
Destroy(player.GetComponent<PlayerAttack>());
2019-04-29 12:35:35 +00:00
player.gameObject.AddComponent<PlayerAttackMelee>();
2019-04-29 08:39:48 +00:00
PlayerAttackMelee pam = player.GetComponent<PlayerAttackMelee>();
pam.damage = this.damage;
2019-04-29 17:53:45 +00:00
pam.attackAnimation = attackAnimation;
2019-04-29 08:39:48 +00:00
}
}