RiftMayhem/Assets/Scripts/Controllers/ArcaneExplosion_Animation.cs
Pedro Sangue3 Gomes 0b530ca632 Spellcasting system começado
Arcane/Magic explosion prototype criado
knowledge level changed to scriptable começado
prefabs de systems criados e atualizados
2019-12-05 00:44:41 +00:00

31 lines
793 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ArcaneExplosion_Animation : MonoBehaviour
{
[SerializeField] private float rangeMultiplier;
[SerializeField] private float animationSpeed;
// Start is called before the first frame update
private void OnEnable()
{
transform.localScale = Vector3.one / 10f;
}
private void Update()
{
transform.localScale = Vector3.Lerp(transform.localScale, Vector3.one * rangeMultiplier, Time.deltaTime * animationSpeed);
if(transform.localScale.x >= rangeMultiplier - 0.1f)
{
DisableExplosion();
}
}
public void DisableExplosion()
{
Destroy(this.gameObject);
//gameObject.SetActive(false);
}
}