Skip to content

Instantly share code, notes, and snippets.

@TakayukiWada
Created January 14, 2017 20:40
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 TakayukiWada/3a4ead7c231f9da27e9b6bf00bcf04ff to your computer and use it in GitHub Desktop.
Save TakayukiWada/3a4ead7c231f9da27e9b6bf00bcf04ff to your computer and use it in GitHub Desktop.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
// お金オブジェクト、プレイヤーに触れたら消える。
public class MoneyObj : MonoBehaviour {
int mMoneyValue = 100;
public GameObject mParent;
void OnTriggerEnter2D(Collider2D col)
{
if (col.gameObject.tag == "Player")
{
// 親を消す
Destroy(mParent);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment