-
-
Save todorok1/775775b88b71c419c06f4d37a0abc5ce 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 System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
/// <Summary> | |
/// コライダーに衝突したゲームオブジェクトを破棄するスクリプトです。 | |
/// </Summary> | |
public class ObjectEraser : MonoBehaviour | |
{ | |
void Start() | |
{ | |
} | |
void Update() | |
{ | |
} | |
/// <Summary> | |
/// コライダーに衝突したゲームオブジェクトを破棄します。 | |
/// </Summary> | |
void OnCollisionEnter(Collision other) | |
{ | |
// 衝突した相手を闇の彼方に消し去ります。 | |
Destroy(other.gameObject); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment