using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class L11 : MonoBehaviour
{
public GameObject myobject;
void Start()
{
//检查游戏对象是激活还是禁用
Debug.Log("Active Sefl:" + myobject.activeSelf);
Debug.Log("Active in Hierarchy" + myobject.activeInHierarchy);
}
// Update is called once per frame
void Update()
{
if(Input.GetKeyUp(KeyCode.Space))
{
//游戏中脚本开关切换
gameObject.SetActive(false);
}
}
}