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

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