Skip to content

Instantly share code, notes, and snippets.

@EsProgram
Created December 3, 2014 00:29
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 EsProgram/76db1483f07ef44d2440 to your computer and use it in GitHub Desktop.
Save EsProgram/76db1483f07ef44d2440 to your computer and use it in GitHub Desktop.
カメラの描画範囲外でDestroy
using System.Collections;
using UnityEngine;
public class DestroyOnOutOfCamera : MonoBehaviour
{
private void OnBecameInvisible()
{
Destroy(gameObject);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment