private IEnumerator wait2sec() { yield return(new WaitForSeconds(2)); SceneManager.LoadScene("FirstGameGameOver", LoadSceneMode.Additive); SoundManagerFG.PlaySound("End"); }
private void OnTriggerEnter2D(Collider2D collision) { if (willPlay == true) { if (collision.gameObject.tag == "acid") { SoundManagerFG.PlaySound("Drown"); playerAnim.gameObject.transform.Rotate(Vector3.zero); playerAnim.SetBool("dead", true); playerAnim.SetBool("IsFalling?", false); willPlay = false; } } }
private void OnTriggerStay2D(Collider2D collision) { if (collision.gameObject.tag == "cursor") { if (!gameObject.GetComponent <FixedJoint2D>()) { gameObject.AddComponent <FixedJoint2D>(); } if (Input.GetKeyDown(KeyCode.Mouse0)) { gameObject.GetComponent <FixedJoint2D>().connectedBody = Instantiate(NewObject, Raypos, Quaternion.identity).GetComponent <Rigidbody2D>(); SoundManagerFG.PlaySound("MetalStick"); } } }
// Use this for initialization void Start() { SoundManagerFG.PlaySound("Background"); playerAnim = GetComponent <Animator>(); Time.enabled = false; }