add some extra assets FX and SFX
This commit is contained in:
33
Assets/PixPlays/Components/Scripts/VfxSystem/LocationVfx.cs
Normal file
33
Assets/PixPlays/Components/Scripts/VfxSystem/LocationVfx.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
namespace PixPlays.ElementalVFX
|
||||
{
|
||||
|
||||
public class LocationVfx : BaseVfx
|
||||
{
|
||||
[SerializeField] VfxReference _LocationEffect;
|
||||
[SerializeField] float _RadiusFactor;
|
||||
[SerializeField] bool _IgnoreYDirection;
|
||||
public override void Play(VfxData data)
|
||||
{
|
||||
base.Play(data);
|
||||
_LocationEffect.transform.localScale = Vector3.one * _RadiusFactor * _data.Radius;
|
||||
_LocationEffect.transform.position = data.Source;
|
||||
Vector3 direction = _data.Target - _data.Source;
|
||||
if (_IgnoreYDirection)
|
||||
{
|
||||
direction.y = 0;
|
||||
}
|
||||
_LocationEffect.transform.forward = direction;
|
||||
_LocationEffect.gameObject.SetActive(true);
|
||||
_LocationEffect.Play();
|
||||
}
|
||||
|
||||
public override void Stop()
|
||||
{
|
||||
base.Stop();
|
||||
_LocationEffect.Stop();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user