Ejemplo n.º 1
0
    private void OnProjectileDestroyed(BaseEventParameters baseParams)
    {
        ProjectileDestroyedEventParameters projectileDestroyedParams = (ProjectileDestroyedEventParameters)baseParams;
        ProjectileComponent destroyedProjectile = projectileDestroyedParams.m_Projectile;

        if (m_CurrentProjectile != null && m_CurrentProjectile == destroyedProjectile)
        {
            // If the attack's launched and teleport has not been requested yet
            if (m_AttackLaunched && !m_TeleportRequested)
            {
                // Save the last know projectile position
                m_LastProjectilePosition = m_CurrentProjectile.transform.position;
            }
            m_CurrentProjectile = null;
        }
    }
Ejemplo n.º 2
0
    private void OnProjectileDestroyed(BaseEventParameters baseParams)
    {
        ProjectileDestroyedEventParameters projectileDestroyedParams = (ProjectileDestroyedEventParameters)baseParams;
        ProjectileComponent destroyedProjectile = projectileDestroyedParams.m_Projectile;

        if (m_MyProjectile == destroyedProjectile)
        {
            Utils.GetEnemyEventManager(m_Owner).StopListening(EPlayerEvent.DamageTaken, OnEnemyTakesDamage);
            m_MyProjectile = null;
        }

        if (!m_CurrentProjectiles.Contains(destroyedProjectile))
        {
            KakutoDebug.LogError("Trying to destroy a projectile which is not in the list");
        }

        m_CurrentProjectiles.Remove(destroyedProjectile);
    }