Beispiel #1
0
        protected virtual void OnEnable()
        {
            if (localVertices.Count == 0)
            {
                GenerateDefaultVertices();
            }

            VLSViewer.AddObstructor(this);
        }
Beispiel #2
0
 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;
        }
Beispiel #5
0
        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();
            }
        }
Beispiel #6
0
        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);
        }
Beispiel #7
0
 void Awake()
 {
     instance = this;
 }
Beispiel #8
0
 void Awake()
 {
     instance = this;
 }
Beispiel #9
0
        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);
 }