Shield spell enter and exit animation

This commit is contained in:
joonasp
2022-05-02 12:15:46 +03:00
parent 9e3bb66973
commit ea08d2704f
14 changed files with 1088 additions and 755 deletions

View File

@@ -13,7 +13,7 @@ public class ShieldController : MonoBehaviour
// Start is called before the first frame update
void Start()
{
GetComponent<Animation>().Play("Shield_init_anim");
}
// Update is called once per frame
@@ -21,6 +21,10 @@ public class ShieldController : MonoBehaviour
{
health -= Time.deltaTime;
GetComponent<Renderer>().material.SetColor("_Color0", Color.Lerp(endColor, startColor, health / 5));
if (health <= 0) Destroy(gameObject);
if (health <= 0)
{
GetComponent<Animation>().Play("Shield_exit_anim");
Destroy(gameObject, 0.25f);
}
}
}