当方、ズブ素人で、分からない箇所があるので教えて下さい
以下のコードが書籍に載っているのですが
if (collition2d.gameObject == gameObject) の所で
collition2dのgameObject が、gameObjectと等しいならとありますが
この何もついていないgameObjectと等しいというのは、どういう意味でしょうか?
すいませんがよろしくお願いします。
----
using UnityEngine;
using System.Collections;
public class Tank : MonoBehaviour {
GameObject goShell = null;
bool action = false;
// Use this for initialization
void Start () {
// 砲弾のゲームオブジェクト取得と砲弾の非表示設定
goShell = transform.FindChild("Tank_Shell").gameObject;
goShell.SetActive (false);
}
// Update is called once per frame
void Update () {
// ボタンが押されたか?
if (Input.GetMouseButton(0)) {
// タンクがクリックされたか?
Vector2 tapPoint = Camera.main.ScreenToWorldPoint(Input.mousePosition);
Collider2D collition2d = Physics2D.OverlapPoint(tapPoint);
if (collition2d) {
if (collition2d.gameObject == gameObject) {
// アクションを有効にする
action = true;
}
}
・・・【以下略】
----
MonoBehaviourから継承してるメンバでは