OnComeInvisible

using UnityEngine;
using System.Collections;

public class LOVE : MonoBehaviour {

bool mVisible = true;

// Use this for initialization
void Start()
{

}

// Update is called once per frame
void Update()
{
if (mVisible)
{
// Debug.Log("CubeRed Update");
}

}

void OnBecameVisible()
{
Debug.Log("CubeRed OnBecameVisible");
mVisible = true;
}

void OnBecameInvisible()
{
Debug.Log("CubeRed OnBecameInvisible");
mVisible = false;
}

}

时间: 2024-10-12 03:22:30

OnComeInvisible的相关文章