Exemplo n.º 1
0
 // Token: 0x06001B7F RID: 7039 RVA: 0x00018064 File Offset: 0x00016264
 public WormMortarShootingState(WormEnemy worm, MortarWormDirectionalAnimations shoot, PrefabSpawner shootEffect, SoundSource shootSound, ProjectileSpawner projectileSpawner, float shootDelay, float projectileDamage) : base(worm)
 {
     this.m_shoot             = shoot;
     this.m_shootEffect       = shootEffect;
     this.m_shootSound        = shootSound;
     this.m_projectileSpawner = projectileSpawner;
     this.m_shootDelay        = shootDelay;
     this.m_projectileDamage  = projectileDamage;
 }
Exemplo n.º 2
0
    void OnWormEnemyTrigger(WormEnemy enemy)
    {
        switch (direction)
        {
        case Directions.Up:
            // If the spike is facing Up and the player is falling
            if (enemy.Speed.y < 0f)
            {
                enemy.Die();
                return;
            }
            break;

        case Directions.Down:
            // If the spike is facing Down and the player is going up
            if (enemy.Speed.y > 0f)
            {
                enemy.Die();
                return;
            }
            break;

        case Directions.Left:
            // If the spike is facing Left and the player is going right
            if (enemy.Speed.x > 0f)
            {
                enemy.Die();
                return;
            }
            break;

        case Directions.Right:
            // If the spike is facing Right and the player is going left
            if (enemy.Speed.x < 0f)
            {
                enemy.Die();
            }
            break;

        case Directions.All:
            enemy.Die();
            break;

        default:
            return;
        }
    }