Arcane/Magic explosion prototype criado knowledge level changed to scriptable começado prefabs de systems criados e atualizados
31 lines
793 B
C#
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);
|
|
}
|
|
}
|