Created
January 23, 2015 09:32
-
-
Save chabiribon/f19e2710224104f9c599 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
public class Switch : MonoBehaviour { | |
public AudioClip audioClip1; | |
// Use this for initialization | |
void Start () { | |
} | |
// Update is called once per frame | |
void Update () { | |
} | |
void OnCollisionEnter2D(Collision2D col){ | |
if(col.gameObject.tag == "switch"){ | |
audio.PlayOneShot (audioClip1); | |
Destroy(col.gameObject); | |
Destroy(GameObject.Find("block_0")); | |
} | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment