后处理+FEEL完全改进
This commit is contained in:
@@ -10,11 +10,14 @@ using SLSFramework.LeanPoolAssistance;
|
||||
using SLSFramework.WwiseAssistance;
|
||||
using SLSUtilities.FunctionalAnimation;
|
||||
using UnityEngine;
|
||||
using Random = UnityEngine.Random;
|
||||
|
||||
namespace Cielonos.MainGame
|
||||
{
|
||||
public abstract partial class AttackAreaBase : MonoBehaviour
|
||||
{
|
||||
private static Dictionary<string, int> areaNameCountDictionary = new Dictionary<string, int>();
|
||||
|
||||
[Title("References")]
|
||||
public CharacterBase creator;
|
||||
public ItemBase itemSource;
|
||||
@@ -25,6 +28,7 @@ namespace Cielonos.MainGame
|
||||
public Dictionary<string, GameObject> functionalParts;
|
||||
|
||||
[Title("Status")]
|
||||
public string areaName;
|
||||
public bool isEnabling;
|
||||
public bool canTriggerHitEvent = true;
|
||||
public Action updateAction;
|
||||
@@ -79,6 +83,12 @@ namespace Cielonos.MainGame
|
||||
{
|
||||
topParent = topParent.parent;
|
||||
}
|
||||
|
||||
if (!areaNameCountDictionary.TryAdd(topParent.name, 1))
|
||||
{
|
||||
areaNameCountDictionary[topParent.name]++;
|
||||
}
|
||||
areaName = $"{topParent.name}_{areaNameCountDictionary[topParent.name]}";
|
||||
|
||||
foreach (TrailRenderer trail in GetComponentsInChildren<TrailRenderer>())
|
||||
{
|
||||
|
||||
@@ -11,8 +11,8 @@ namespace Cielonos.MainGame
|
||||
{
|
||||
public bool isOverridingHitEffect;
|
||||
public GameObject hitVFXPrefab;
|
||||
public GameObject damageNumberRegularPrefab;
|
||||
public GameObject damageNumberCriticalPrefab;
|
||||
public DamageNumber damageNumberRegularPrefab;
|
||||
public DamageNumber damageNumberCriticalPrefab;
|
||||
|
||||
public AttackValue originalAttackValue;
|
||||
public AttackValue modifiedAttackValue;
|
||||
@@ -45,9 +45,9 @@ namespace Cielonos.MainGame
|
||||
|
||||
public void SpawnDamageNumber(Vector3 position, bool isCritical, float finalDamage)
|
||||
{
|
||||
GameObject damageNumberGameObject = isCritical ? damageNumberCriticalPrefab : damageNumberRegularPrefab;
|
||||
DamageNumber damageNumber = Object.Instantiate(damageNumberGameObject, position, Quaternion.identity).GetComponent<DamageNumber>();
|
||||
damageNumber.number = finalDamage;
|
||||
DamageNumber finalDN = isCritical ? damageNumberCriticalPrefab : damageNumberRegularPrefab;
|
||||
DamageNumber damageNumber = finalDN.Spawn(position, finalDamage);
|
||||
damageNumber.spamGroup = attackArea.areaName;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8,14 +8,16 @@ namespace Cielonos.MainGame
|
||||
{
|
||||
public partial class HitSubmodule : AttackAreaSubmoduleBase
|
||||
{
|
||||
public int hitCount;
|
||||
public int originalHitCount;
|
||||
public int currentHitIndex;
|
||||
public float hitInterval;
|
||||
private float currentIntervalTime;
|
||||
|
||||
public List<GameObject> checkedObjects;
|
||||
public bool isAutoPlayHitSound;
|
||||
public List<string> hitSoundList;
|
||||
public List<Action<CharacterBase, Vector3>> hitEventList;
|
||||
public List<Action<CharacterBase, Vector3>> generalHitEventList;
|
||||
public SortedList<int, Action<CharacterBase, Vector3>> specificHitEventList;
|
||||
|
||||
public HitSubmodule(AttackAreaBase attackArea) : base(attackArea)
|
||||
{
|
||||
@@ -30,15 +32,17 @@ namespace Cielonos.MainGame
|
||||
}
|
||||
|
||||
private void InitializeAsOnceHit()
|
||||
{
|
||||
this.hitCount = 1;
|
||||
{
|
||||
this.originalHitCount = 1;
|
||||
this.currentHitIndex = 0;
|
||||
this.hitInterval = -1;
|
||||
this.currentIntervalTime = 0;
|
||||
}
|
||||
|
||||
private void InitializeAsMultipleHit(float hitInterval, int hitCount)
|
||||
{
|
||||
this.hitCount = hitCount;
|
||||
this.originalHitCount = hitCount;
|
||||
this.currentHitIndex = 0;
|
||||
this.hitInterval = hitInterval;
|
||||
this.currentIntervalTime = 0;
|
||||
}
|
||||
@@ -48,7 +52,8 @@ namespace Cielonos.MainGame
|
||||
isAutoPlayHitSound = true;
|
||||
checkedObjects = new List<GameObject>();
|
||||
hitSoundList = new List<string>();
|
||||
hitEventList = new List<Action<CharacterBase, Vector3>>();
|
||||
generalHitEventList = new List<Action<CharacterBase, Vector3>>();
|
||||
specificHitEventList = new SortedList<int, Action<CharacterBase, Vector3>>();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,7 +83,16 @@ namespace Cielonos.MainGame
|
||||
|
||||
public HitSubmodule AddHitEvent(Action<CharacterBase, Vector3> hitEvent)
|
||||
{
|
||||
hitEventList.Add(hitEvent);
|
||||
generalHitEventList.Add(hitEvent);
|
||||
return this;
|
||||
}
|
||||
|
||||
public HitSubmodule AddHitEvent(Action<CharacterBase, Vector3> hitEvent, params int[] indexes)
|
||||
{
|
||||
foreach (int i in indexes)
|
||||
{
|
||||
specificHitEventList[i] = hitEvent;
|
||||
}
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -87,7 +101,7 @@ namespace Cielonos.MainGame
|
||||
{
|
||||
public void Update()
|
||||
{
|
||||
if (!isEnabling || hitCount <= 1 || attackArea.timeSm.delayTime > 0)
|
||||
if (!isEnabling || currentHitIndex >= originalHitCount - 1 || attackArea.timeSm.delayTime > 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -101,10 +115,10 @@ namespace Cielonos.MainGame
|
||||
//attackArea.attackSm.modifiedAttackValue = attackArea.attackSm.originalAttackValue;
|
||||
}
|
||||
currentIntervalTime -= hitInterval;
|
||||
hitCount--;
|
||||
currentHitIndex++;
|
||||
}
|
||||
|
||||
if (hitCount <= 0)
|
||||
if (currentHitIndex >= originalHitCount - 1)
|
||||
{
|
||||
attackArea.isEnabling = false;
|
||||
}
|
||||
@@ -126,10 +140,16 @@ namespace Cielonos.MainGame
|
||||
{
|
||||
if (attackArea.canTriggerHitEvent)
|
||||
{
|
||||
foreach (Action<CharacterBase, Vector3> hitEvent in hitEventList)
|
||||
foreach (Action<CharacterBase, Vector3> hitEvent in generalHitEventList)
|
||||
{
|
||||
hitEvent.Invoke(target, hitPosition);
|
||||
}
|
||||
|
||||
Debug.Log($"[HitSubmodule] Invoking specific hit event for hit index {currentHitIndex}.");
|
||||
if (specificHitEventList.ContainsKey(currentHitIndex))
|
||||
{
|
||||
specificHitEventList[currentHitIndex].Invoke(target, hitPosition);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user