コード例 #1
0
    private IEnumerator wait2sec()
    {
        yield return(new WaitForSeconds(2));

        SceneManager.LoadScene("FirstGameGameOver", LoadSceneMode.Additive);
        SoundManagerFG.PlaySound("End");
    }
コード例 #2
0
 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;
         }
     }
 }
コード例 #3
0
 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");
         }
     }
 }
コード例 #4
0
 // Use this for initialization
 void Start()
 {
     SoundManagerFG.PlaySound("Background");
     playerAnim   = GetComponent <Animator>();
     Time.enabled = false;
 }