private void OnTriggerEnter(Collider other) { if (other.gameObject.CompareTag("Chick")) { PlaySounds.SFXInstance().PlaySound(1); } }
private void OnTriggerEnter2D(Collider2D other) { if (other.gameObject.CompareTag("Chick")) { StartCoroutine(ThunderFlash()); PlaySounds.SFXInstance().PlaySound(1); GameManager.instance.content = false; } }
private void OnParticleCollision() { content = false; print("I'm scared"); if (!play) { PlaySounds.SFXInstance().PlaySound(2); play = true; } }
private void OnTriggerEnter2D(Collider2D other) { if (!play) { if (other.CompareTag("Chick")) { PlaySounds.SFXInstance().PlaySound(1); GameManager.instance.content = false; play = true; } } }
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; } }
/*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; } } }
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; * }*/ }
/*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; } } }
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(); } }
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; } }
public void AddRain() { PlaySounds.SFXInstance().ambientRain.Stop(); PlaySounds.SFXInstance().ambientRain.clip = PlaySounds.SFXInstance().outsideRain; PlaySounds.SFXInstance().ambientRain.Play(); }
public void CrackEffects() { PlaySounds.SFXInstance().PlaySound(5); Time.timeScale = 0.5f; eggBreak.Play(); }
public void EndAnim() { PlaySounds.SFXInstance().PlaySound(3); }