GameObjectの表示・非表示についてのメモ
C#
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ClaccName : MonoBehaviour {
GameObject obj;
// Use this for initialization
void Start () {
// シーンのゲームオブジェクトを取得する
obj = GameObject.Find("Object");
}
// Update is called once per frame
void Update () {
// ゲームオブジェクトが表示されているかどうかのステータスを取得
bool isActive;
isActive = obj.activeSelf;
// ゲームオブジェクトを表示させる
obj.SetActive(true);
// ゲームオブジェクトを非表示にする
obj.SetActive(false);
}
}