Example #1
0
 public void CheckIfShoot()
 {
     if (detectedPlayer)
     {
         StartShooting();
     }
     else
     {
         shootFrequenceSystem.Stop();
     }
 }
 public void CheckForShootAgain()
 {
     if (isShootingInputDown && !IsStunned && !dead && !won)
     {
         ShootProjectile();
     }
     else
     {
         shootingFrequenceSystem.Stop();
         shootingFrequenceSystem.ResetFrequence();
         charaFlower.ResetShooting();
     }
 }
Example #3
0
    private void Start()
    {
        shootFrequenceSystem = new FrequenceSystem(projectilesPerSecond);
        shootFrequenceSystem.SetUp(CheckIfShoot);
        shootFrequenceSystem.Stop();

        lifeSystem.OnReceivedDamages += PlayHitFeedback;
        lifeSystem.OnLifeReachedZero += Die;
        //enemyRenderer.material = normalMaterial;

        SetUpRenderer();
        //rendererParent.rotation = Quaternion.Euler(0, currentShootDirection == ShootDirection.Right ? 0 : 180, 0);
    }
    private void Start()
    {
        jumpDurationSystem       = new TimerSystem(jumpMaxDuration, EndJumping);
        lateJumpDurationSystem   = new TimerSystem(lateJumpDelay, null);
        extentJumpDurationSystem = new TimerSystem(extentJumpDelay, null);

        shootingFrequenceSystem = new FrequenceSystem(bulletsPerSecond);
        shootingFrequenceSystem.SetUp(CheckForShootAgain);
        shootingFrequenceSystem.Stop();

        SetUpLifeSystem();

        // characterRenderer.material = normalMaterial;
        SetUpRenderer();

        /*walkStepFrequenceSystem = new FrequenceSystem(stepFeedbackPerSecond);
         * walkStepFrequenceSystem.SetUp(PlayFootFeedbackSound);*/

        //AudioManager.PlayAmbianceMusic();
        charaFlower.SetCurrentGlobalTarget(currentShootDirection == ShootDirection.Left ? leftShootPosition : rightShootPosition, currentShootDirection);
    }