Пример #1
0
 private void OnTriggerEnter(Collider other)
 {
     if (other.gameObject.CompareTag("Chick"))
     {
         PlaySounds.SFXInstance().PlaySound(1);
     }
 }
Пример #2
0
 private void OnTriggerEnter2D(Collider2D other)
 {
     if (other.gameObject.CompareTag("Chick"))
     {
         StartCoroutine(ThunderFlash());
         PlaySounds.SFXInstance().PlaySound(1);
         GameManager.instance.content = false;
     }
 }
Пример #3
0
 private void OnParticleCollision()
 {
     content = false;
     print("I'm scared");
     if (!play)
     {
         PlaySounds.SFXInstance().PlaySound(2);
         play = true;
     }
 }
Пример #4
0
 private void OnTriggerEnter2D(Collider2D other)
 {
     if (!play)
     {
         if (other.CompareTag("Chick"))
         {
             PlaySounds.SFXInstance().PlaySound(1);
             GameManager.instance.content = false;
             play = true;
         }
     }
 }
Пример #5
0
    void Whistle()
    {
        if (Input.GetButtonDown(chirpAxis))
        {
            PlaySounds.SFXInstance().PlaySound(0);

            GameManager.instance.followtheHen = false;
        }
        else if (Input.GetButtonUp(chirpAxis))
        {
            print("Im true!");
            GameManager.instance.followtheHen = true;
        }
    }
Пример #6
0
    /*void Jump()
     * {
     *      grounded = Physics2D.Linecast(transform.position, groundCheck.position, 1 << LayerMask.NameToLayer("Floor"));
     *
     *      if (Input.GetButtonDown(jumpButton) && grounded && !GameManager.instance.hideTheChick)
     *      {
     *              rb.AddForce(new Vector2(0, jumpPower), ForceMode2D.Impulse);
     *      }
     * }*/

    void Whistle()
    {
        if (Input.GetButtonDown(chirpButton) && !GameManager.instance.inCutscene)
        {
            PlaySounds.SFXInstance().PlaySound(0);
            if (GameManager.instance.followtheHen)
            {
                GameManager.instance.followtheHen = false;
            }

            else
            {
                GameManager.instance.followtheHen = true;
            }
        }
    }
Пример #7
0
    private void OnParticleCollision()
    {
        //timeSinceLastScare += Time.deltaTime;
        GameManager.instance.content = false;
        PlaySounds.SFXInstance().PlaySound(4);
        PlaySounds.SFXInstance().PlaySound(2);


        anim.SetBool("Hiding", true);

        /*if (timeSinceLastScare >= timeToScare)
         * {
         *
         *  timeSinceLastScare = 0;
         * }*/
    }
Пример #8
0
    /*void Jump()
     * {
     *      grounded = Physics2D.Linecast(transform.position, groundCheck.position, 1 << LayerMask.NameToLayer("Floor"));
     *
     *      if (Input.GetButtonDown(jumpButton) && grounded && !GameManager.instance.hideTheChick)
     *      {
     *              rb.AddForce(new Vector2(0, jumpPower), ForceMode2D.Impulse);
     *      }
     * }*/

    void Whistle()
    {
        if (Input.GetButtonDown(chirpButton) && !GameManager.instance.inCutscene && !GameManager.instance.restartingFromLastCheckpoint)
        {
            PlaySounds.SFXInstance().PlaySound(0);
            if (GameManager.instance.followtheHen)
            {
                GameManager.instance.followtheHen = false;
            }

            else
            {
                GameManager.instance.followtheHen = true;
                GameManager.instance.distracted   = false;
            }
        }
    }
Пример #9
0
    void Awake()
    {
        _transform       = GetComponent <Transform>();
        mySpriteRenderer = GetComponent <SpriteRenderer>();
        anim             = GetComponent <Animator>();
        NullChecking();

        GameManager.instance.lastCheckpoint = transform.position;

        if (!PlaySounds.SFXInstance().ambientRain.isPlaying)
        {
            PlaySounds.SFXInstance().ambientRain.Play();
        }

        if (!GameManager.instance.music.isPlaying)
        {
            GameManager.instance.music.Play();
        }
    }
Пример #10
0
 public void ResetGameState(bool isFullRestart)
 {
     if (isFullRestart)
     {
         hideTheChick                 = false;
         fullRestart                  = false;
         followtheHen                 = false;
         henIsCharging                = false;
         inCutscene                   = false;
         chickIsHiding                = false;
         inLaterLevel                 = false;
         crackTheEgg                  = false;
         content                      = false;
         pecking                      = false;
         followInCutscene             = true;
         restartingFromLastCheckpoint = false;
         PlaySounds.SFXInstance().ambientRain.Stop();
         PlaySounds.SFXInstance().ambientRain.clip = PlaySounds.SFXInstance().insideRain;
     }
 }
Пример #11
0
 public void AddRain()
 {
     PlaySounds.SFXInstance().ambientRain.Stop();
     PlaySounds.SFXInstance().ambientRain.clip = PlaySounds.SFXInstance().outsideRain;
     PlaySounds.SFXInstance().ambientRain.Play();
 }
Пример #12
0
 public void CrackEffects()
 {
     PlaySounds.SFXInstance().PlaySound(5);
     Time.timeScale = 0.5f;
     eggBreak.Play();
 }
Пример #13
0
 public void EndAnim()
 {
     PlaySounds.SFXInstance().PlaySound(3);
 }