Skip to content

Instantly share code, notes, and snippets.

@todorok1
Created September 3, 2020 07:49
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 todorok1/cf0da2daee8531e9f9582860526f7ef9 to your computer and use it in GitHub Desktop.
Save todorok1/cf0da2daee8531e9f9582860526f7ef9 to your computer and use it in GitHub Desktop.
対象のゲームオブジェクトを破棄するスクリプトです。
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
/// <Summary>
/// 対象のゲームオブジェクトを破棄するスクリプトです。
/// </Summary>
public class ObjectDestroyer : MonoBehaviour
{
// 破棄するオブジェクトへの参照を保持します。
public GameObject targetObj;
void Start()
{
// 引数のGameObjectを破棄します。
Destroy(targetObj);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment