diff --git a/Assets/Prefabs/ShopKeeperCanvas.prefab b/Assets/Prefabs/ShopKeeperCanvas.prefab index 387cad3b72f5f412f3e9a204100e97d039e25555..faa79eb3b6f0d4f894cbaeba4edf05557dd586d3 100644 --- a/Assets/Prefabs/ShopKeeperCanvas.prefab +++ b/Assets/Prefabs/ShopKeeperCanvas.prefab @@ -239,7 +239,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0.5} m_AnchorMax: {x: 0, y: 0.5} - m_AnchoredPosition: {x: 7694.946, y: 140} + m_AnchoredPosition: {x: 7823.336, y: 140} m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0, y: 1} --- !u!114 &6427786897761567691 diff --git a/Assets/Scripts/Pets/PetAttack.cs b/Assets/Scripts/Pets/PetAttack.cs index 0f7214bcc58e063bd9ed3b9f3f70c7a163e5988a..3c9096b266ab75067bc045a1346be7fd64ea8149 100644 --- a/Assets/Scripts/Pets/PetAttack.cs +++ b/Assets/Scripts/Pets/PetAttack.cs @@ -8,13 +8,10 @@ public class PetAttack : MonoBehaviour public float timeBetweenAttacks = 0.5f; public int attackDamage = 10; - GameObject[] enemy; - GameObject[] enemyInRange; Animator anim; GameObject player; PlayerHealth playerHealth; EnemyHealth enemyHealth; - bool playerInRange; bool attacking; float timer; @@ -28,7 +25,7 @@ public class PetAttack : MonoBehaviour void OnTriggerStay(Collider other) { - if (enemy.Contains(other.gameObject)) + if (other.tag == "Enemy") { Attack(other.gameObject); } @@ -44,11 +41,6 @@ public class PetAttack : MonoBehaviour { attacking = true; } - - if (playerHealth.currentHealth <= 0) - { - anim.SetTrigger ("PlayerDead"); - } } }