Пример #1
0
    private void ApplyConfusionTo(GameObject user)
    {
        StatusCollection statuses = user.GetComponentInChildren <StatusCollection>();

        if (statuses != null)
        {
            Status confusion = Instantiate(ConfusionStatus);
            statuses.AddStatus(confusion);
            confusion.Emitter.Emit(new OnStatusStartEventData(user, gameObject, 5f));
        }
    }
Пример #2
0
    public void Cast(OnPointTargetCastEventData e)
    {
        StatusCollection statusCollection =
            e.Caster.GetComponentInChildren <StatusCollection>();

        if (statusCollection != null)
        {
            Status posionStatus = Instantiate(PosionStatus);
            statusCollection.AddStatus(posionStatus);
            posionStatus.Emitter.Emit(
                new OnStatusStartEventData(e.Caster, gameObject, 3f)
                );
        }
    }
Пример #3
0
    public void HitTarget(OnCastHitTargetEventData e)
    {
        Skill.GetEmitter().Emit(e);
        StatusCollection StatusCollection =
            e.With.GetComponentInChildren <StatusCollection>();
        Status PosionStatus = Instantiate(StatusPrefab);

        StatusCollection.AddStatus(
            PosionStatus
            );
        hasHit = true;
        PosionStatus.Emitter.Emit(
            new OnStatusStartEventData(e.With.gameObject, gameObject, 3f)
            );
        StartCoroutine(DestroyAfter(1f));
    }
Пример #4
0
    private void OnCastHit(OnCastHitTargetEventData e)
    {
        StatusCollection StatusCollection =
            e.With.GetComponentInChildren <StatusCollection>();

        if (e.With == e.Caster.gameObject)
        {
            return;                               //dont collider with self
        }
        if (e.With.layer == e.Caster.layer)
        {
            return;                                //dont collide with shared tags as caster
        }
        if (StatusCollection != null)
        {
            Status PosionStatus = Instantiate(this.PosionStatus);
            StatusCollection.AddStatus(PosionStatus);
            PosionStatus.Emitter.Emit(
                new OnStatusStartEventData(e.With, gameObject, 3f)
                );
        }
    }