Created
January 14, 2017 20:40
-
-
Save TakayukiWada/3a4ead7c231f9da27e9b6bf00bcf04ff 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; | |
// お金オブジェクト、プレイヤーに触れたら消える。 | |
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