Skip to content

Instantly share code, notes, and snippets.

@aidiary
Last active October 11, 2018 00:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aidiary/c27e78ec800746c56d5e to your computer and use it in GitHub Desktop.
Save aidiary/c27e78ec800746c56d5e to your computer and use it in GitHub Desktop.
ボールが地面から落下したときに削除
#pragma strict
// BallLife.js
// Ballが落下した場合にオブジェクトを削除
var maxFallDistance : int = -10;
function Update () {
if (transform.position.y <= maxFallDistance) {
// 自分自身を削除
Destroy(gameObject);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment