loot table added - AI improved a bit
This commit is contained in:
@@ -19,6 +19,8 @@ public class SlimeAI : MonoBehaviour
|
||||
private bool isRotatingRight = false;
|
||||
private bool isWalking = false;
|
||||
|
||||
public UnityEvent onDeathComplete;
|
||||
|
||||
//[SerializeField]
|
||||
//private UnityEvent onAttack;
|
||||
|
||||
@@ -27,7 +29,7 @@ public class SlimeAI : MonoBehaviour
|
||||
{
|
||||
animator = GetComponent<Animator>();
|
||||
player = GameObject.FindWithTag("Player");
|
||||
HP = 10;
|
||||
HP = 2;
|
||||
|
||||
}
|
||||
|
||||
@@ -73,9 +75,6 @@ public class SlimeAI : MonoBehaviour
|
||||
//Idle
|
||||
StartCoroutine("Wander");
|
||||
}
|
||||
Debug.Log(isWandering);
|
||||
Debug.Log(isRotatingLeft);
|
||||
Debug.Log(isRotatingRight);
|
||||
if (isRotatingRight == true)
|
||||
{
|
||||
animator.SetBool("Wandering", false);
|
||||
@@ -94,13 +93,17 @@ public class SlimeAI : MonoBehaviour
|
||||
if (HP <= 0)
|
||||
{
|
||||
animator.SetBool("Dead", true);
|
||||
|
||||
}
|
||||
if (animator.GetBool("DeathComplete"))
|
||||
if (animator.GetBool("Dead"))
|
||||
{
|
||||
print("asd");
|
||||
Destroy(this.gameObject);
|
||||
onDeathComplete.Invoke();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
void Rotate()
|
||||
|
||||
Reference in New Issue
Block a user