loot table added - AI improved a bit

This commit is contained in:
2022-05-02 14:28:44 +03:00
parent a748b342a8
commit 6571056d18
78 changed files with 4065 additions and 1895 deletions

View File

@@ -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()