public class denlu : MonoBehaviour {
public GameObject xy;
public bool xy1 = false ;
void OnMouseOver()
{
if(Input .GetMouseButton(0))
xy1 = true;
}
public void Awake()
{
if(xy1)
xy.activeSelf = false ;
}
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
}
}
下面是错误提示
Assets/script/denlu.cs(16,28): error CS0200: Property or indexer `UnityEngine.GameObject.activeSelf' cannot be assigned to (it is read only)