/ObjectEraser_01.cs Secret
Created
September 3, 2020 09:01
Star
You must be signed in to star a gist
衝突相手のタグを確認するサンプル
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
/// <Summary> | |
/// コライダーに衝突したゲームオブジェクトを破棄します。 | |
/// </Summary> | |
void OnCollisionEnter(Collision other) | |
{ | |
if (other.gameObject.tag == "Bullet") | |
{ | |
// 衝突した相手を闇の彼方に消し去ります。 | |
Destroy(other.gameObject); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment