我说次元斩
This commit is contained in:
@@ -144,8 +144,8 @@ namespace Cielonos.MainGame
|
||||
if (attackUnit.useVFXDataHit)
|
||||
{
|
||||
hitVFX ??= itemSource != null
|
||||
? itemSource.vfxData.Get(attackUnit.vfxUnitName).hitVFX
|
||||
: creator.vfxData.Get(attackUnit.vfxUnitName).hitVFX;
|
||||
? itemSource.vfxData.Get(attackUnit.vfxUnitName)?.hitVFX
|
||||
: creator.vfxData.Get(attackUnit.vfxUnitName)?.hitVFX;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -56,6 +56,7 @@ namespace Cielonos.MainGame
|
||||
public GameObject hitVFX;
|
||||
[ShowIf("useVFXDataHit")]
|
||||
public string vfxUnitName;
|
||||
public bool randomizeVfxRotation;
|
||||
|
||||
[Title("Extra Modules")]
|
||||
[ListDrawerSettings(ShowFoldout = true)]
|
||||
|
||||
@@ -68,8 +68,15 @@ namespace Cielonos.MainGame
|
||||
{
|
||||
GameObject hitEffect = base.GenerateHitEffect(target, hitCollider, hitPosition);
|
||||
if(hitEffect == null) return null;
|
||||
|
||||
Vector3 hitEffectDirection = GetHitEffectDirection(hitCollider.ClosestPoint(transform.position));
|
||||
hitEffect.transform.rotation = Quaternion.LookRotation(hitEffectDirection);
|
||||
Quaternion rotation = Quaternion.LookRotation(hitEffectDirection);
|
||||
if (attackSm.attackUnit.randomizeVfxRotation)
|
||||
{
|
||||
rotation *= Quaternion.Euler(Random.Range(0f, 360f), Random.Range(0f, 360f), 0);
|
||||
}
|
||||
|
||||
hitEffect.transform.rotation = rotation;
|
||||
return hitEffect;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ using DamageNumbersPro;
|
||||
using Lean.Pool;
|
||||
using UnityEngine;
|
||||
using Object = UnityEngine.Object;
|
||||
using Random = UnityEngine.Random;
|
||||
|
||||
namespace Cielonos.MainGame
|
||||
{
|
||||
@@ -34,7 +35,12 @@ namespace Cielonos.MainGame
|
||||
if (hitVFXPrefab != null)
|
||||
{
|
||||
direction = direction != default ? direction : Vector3.up;
|
||||
GameObject hitEffect = VFXObject.Spawn(hitVFXPrefab, creator, position, Quaternion.LookRotation(direction));
|
||||
Quaternion rotation = Quaternion.LookRotation(direction);
|
||||
if (attackUnit.randomizeVfxRotation)
|
||||
{
|
||||
rotation *= Quaternion.Euler(Random.Range(0f, 360f), Random.Range(0f, 360f), 0);
|
||||
}
|
||||
GameObject hitEffect = VFXObject.Spawn(hitVFXPrefab, creator, position, rotation);
|
||||
return hitEffect;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user