using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.Events; public class NetworkedAreaOfEffectWithImpactEvent : NetworkedAreaOfEffect { public float impactDelay; public UnityEvent> onImpactHappened = new UnityEvent>(); protected override void Awake() { base.Awake(); } public override void Init() { StartCoroutine(ApplyTelegraphDelay(impactDelay)); } protected override IEnumerator ApplyTelegraphDelay(float delay) { effectVisual.SetActive(true); yield return new WaitForSeconds(impactDelay); CheckSurroundings(); } protected override void ApplyArea() { } protected override void CheckSurroundings() { base.CheckSurroundings(); //TODO: spread the total value over ticks, for now just apply the instant effect every tick, manage tick values on effect applied onImpactHappened.Invoke(ownerTag, targets); StartCoroutine(SelfDestruct()); } }