Shield spell enter and exit animation
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user