Exemplo n.º 1
0
    public void React(BaseProjectileObject projectile_object, Action OnBulletDestroy)
    {
        if (projectile_object.fromCharacter != null && projectile_object.fromCharacter.team == team)
        {
            return;
        }

        if (OnDestroy != null)
        {
            OnDestroy(this);
        }
    }
Exemplo n.º 2
0
    public void React(BaseProjectileObject projectile_object, System.Action projectileDestroyEvent)
    {
        if (projectile_object.fromCharacter == _unit || projectile_object.fromCharacter == null)
        {
            return;
        }

        if (lastAttackTime + attackPeriod > Time.time)
        {
            if (this.interactEvent != null)
            {
                Vector3 dir = (projectile_object.fromCharacter.transform.position - _unit.transform.position).normalized;
                this.interactEvent(dir);
            }

            if (projectileDestroyEvent != null)
            {
                projectileDestroyEvent();
            }
        }
    }