Skip to content

Instantly share code, notes, and snippets.

@toshikaz55
Created March 24, 2014 06:59
Show Gist options
  • Save toshikaz55/9735426 to your computer and use it in GitHub Desktop.
Save toshikaz55/9735426 to your computer and use it in GitHub Desktop.
Unityで弾を発射するスクリプトの弾に付けるスクリプト javascript版
#pragma strict
function Start () {
}
function Update () {
}
function OnCollisionEnter( collisionInfo : Collision ) {
if( collisionInfo.gameObject.tag == "enemy" ) {
collisionInfo.gameObject.SendMessage( "ApplyDamage" );
}
Destroy( gameObject );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment