public void TickPosion(OnStatusTickEventData e)
    {
        OnDamageEventEmitter emitter =
            e.Target.GetComponentInChildren <OnDamageEventEmitter>();

        if (emitter != null)
        {
            emitter.Emit(new OnDamageRecievedEventData(e.Source, 5f));
        }
        if (cTimer < e.Duration)
        {
            StartCoroutine(RetickAfter(0.5f, e));
        }
        else
        {
            Emitter.Emit(
                new OnStatusEndEventData(e.Target)
                );
        }
    }
Beispiel #2
0
    public void TickConfusion(OnStatusTickEventData e)
    {
        MovableBody movableBody =
            e.Target.GetComponentInChildren <MovableBody>();

        if (movableBody != null)
        {
            RemoveLastRandomMovement(movableBody);
            AddRandomMovement(movableBody);
        }
        if (cTimer < e.Duration)
        {
            StartCoroutine(RetickAfter(0.1f, e));
        }
        else
        {
            Emitter.Emit(
                new OnStatusEndEventData(e.Target)
                );
        }
    }
    private IEnumerator RetickAfter(float s, OnStatusTickEventData withData)
    {
        yield return(new WaitForSeconds(s));

        Emitter.Emit(withData);
    }
 public void Emit(OnStatusTickEventData e)
 {
     Handler.OnStatusTick.Invoke(e);
 }