Skip to content
Snippets Groups Projects
Commit ca5a16d9 authored by dawetmaster's avatar dawetmaster
Browse files
parents af8df23f a07ebb11
Branches
Tags
No related merge requests found
...@@ -9,14 +9,14 @@ public class PetAttack : MonoBehaviour ...@@ -9,14 +9,14 @@ public class PetAttack : MonoBehaviour
public int timeBetweenAttack = 1; public int timeBetweenAttack = 1;
public float range = 3f; public float range = 3f;
public float detectRadius = 3f; public float detectRadius = 3f;
float timer; float timer;
PetHealth petHealth; PetHealth petHealth;
Animator anim; Animator anim;
RaycastHit raycastHit; RaycastHit raycastHit;
int shootableMask; int shootableMask;
void Awake() void Start()
{ {
anim = GetComponent<Animator>(); anim = GetComponent<Animator>();
petHealth = GetComponent<PetHealth>(); petHealth = GetComponent<PetHealth>();
......
...@@ -11,12 +11,7 @@ public class PetAttackerMovement : PetMovement ...@@ -11,12 +11,7 @@ public class PetAttackerMovement : PetMovement
public float maxDistanceToEnemy = 2f; public float maxDistanceToEnemy = 2f;
RaycastHit raycastHit; RaycastHit raycastHit;
int shootableMask; int shootableMask = LayerMask.GetMask("Shootable");
private void Start()
{
shootableMask = LayerMask.GetMask("Shootable");
}
void Update() void Update()
{ {
......
...@@ -38,7 +38,7 @@ public class PetHealth : MonoBehaviour ...@@ -38,7 +38,7 @@ public class PetHealth : MonoBehaviour
petAttack = GetComponent<PetAttack>(); petAttack = GetComponent<PetAttack>();
petBuff = GetComponent<PetBuff>(); petBuff = GetComponent<PetBuff>();
AudioClip hurtClip = petAudio.clip; AudioClip hurtClip = petAudio.clip;
currentHealth = startingHealth; currentHealth = startingHealth;
// Show GameObject UI // Show GameObject UI
...@@ -65,6 +65,7 @@ public class PetHealth : MonoBehaviour ...@@ -65,6 +65,7 @@ public class PetHealth : MonoBehaviour
if (CheatMenu.killpet) if (CheatMenu.killpet)
{ {
Death(); Death();
CheatMenu.killpet = false;
} }
} }
......
...@@ -10,8 +10,8 @@ public class PetMovement: MonoBehaviour ...@@ -10,8 +10,8 @@ public class PetMovement: MonoBehaviour
Animator anim; Animator anim;
public float rotationSpeed = 10f; public float rotationSpeed = 10f;
void Awake() void Start()
{ {
GameObject player = GameObject.FindGameObjectWithTag("Player"); GameObject player = GameObject.FindGameObjectWithTag("Player");
target = player.transform; target = player.transform;
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment