void Awake() { PUBLIC = this; worldToTex = textureSize / worldSize; basePoint = transform.position; basePoint.x -= worldSize * 0.5f; basePoint.z -= worldSize * 0.5f; sqrTextureSize = textureSize * textureSize; mBuffer0 = new Color32[sqrTextureSize]; mBuffer1 = new Color32[sqrTextureSize]; mBuffer2 = new Color32[sqrTextureSize]; mRevealers.Clear(); mRemoved.Clear(); mAdded.Clear(); // Add a thread update function -- all visibility checks will be done on a separate thread mThread = new Thread(ThreadUpdate); mThreadWork = true; mThread.Start(); GetComponentInChildren <Projector>(true).gameObject.SetActive(true); }
private void OnDestroy() { FOWSystem.DelRevealer(this); }
private void Start() { FOWSystem.AddRevealer(this); }