protected virtual void OnEnable() { if (localVertices.Count == 0) { GenerateDefaultVertices(); } VLSViewer.AddObstructor(this); }
protected virtual void OnDisable() { VLSViewer.RemoveObstructor(this); foreach (VLSLight light in VLSViewer.VisibleLights) { if (this.bounds.Overlaps(light.bounds)) { light.SetDirty(); } } }
protected virtual void OnEnable() { VLSViewer.AddVLSLight(this); if (gameObject.isStatic) { isStatic = true; } flagUpdate = true; }
protected virtual void Update() { if (verticesDirty || transform.hasChanged) { Active(VLSViewer.IsInView(bounds)); isDirty = true; GlobalizeVertices(); RefreshRectBounds(); } verticesDirty = false; }
public static void Exists() { if (instance == null) { instance = GameObject.FindObjectOfType <VLSViewer>(); if (instance == null) { GameObject go = new GameObject("VLS Viewer"); instance = go.AddComponent <VLSViewer>(); } VisibleLights.Clear(); VisibleObstructions.Clear(); } }
public static bool IsInView(Rect _bound) { if (!Application.isPlaying) { return(true); } if (cameraList.Length == 0) { VLSViewer.CheckForNewCameras(); } for (int i = 0; i < cameraBoundList.Length; i++) { if (cameraBoundList[i].Overlaps(_bound)) { return(true); } } return(false); }
void Awake() { instance = this; }
public static void Exists() { if (instance == null) { instance = GameObject.FindObjectOfType<VLSViewer>(); if (instance == null) { GameObject go = new GameObject("VLS Viewer"); instance = go.AddComponent<VLSViewer>(); } VisibleLights.Clear(); VisibleObstructions.Clear(); } }
protected virtual void Awake() { id = Id++; VLSViewer.Exists(); }
protected virtual void OnDisable() { VLSViewer.RemoveVLSLight(this); }