public void RegisterWaterVolume(LuxWater_WaterVolume item)
 {
     this.RegisteredWaterVolumes.Add(item);
     this.WaterMeshes.Add(item.WaterVolumeMesh);
     this.WaterMaterials.Add(item.transform.GetComponent <Renderer>().sharedMaterial);
     this.WaterTransforms.Add(item.transform);
 }
예제 #2
0
        public void EnteredWaterVolume(
            LuxWater_WaterVolume item,
            int ID,
            Camera triggerCam,
            float GridSize)
        {
            this.DoUnderWaterRendering = true;
            int num = this.RegisteredWaterVolumesIDs.IndexOf(ID);

            if (num != this.activeWaterVolume)
            {
                this.activeWaterVolume = num;
                this.activeGridSize    = GridSize;
                this.WaterSurfacePos   = (float)this.WaterTransforms[this.activeWaterVolume].get_position().y;
                for (int index = 0; index < this.m_aboveWatersurface.Count; ++index)
                {
                    this.m_aboveWatersurface[index].set_renderQueue(2997);
                }
                for (int index = 0; index < this.m_belowWatersurface.Count; ++index)
                {
                    this.m_belowWatersurface[index].set_renderQueue(3001);
                }
            }
            if (this.activeWaterVolumeCameras.Contains(triggerCam))
            {
                return;
            }
            this.activeWaterVolumeCameras.Add(triggerCam);
        }
예제 #3
0
        public void EnteredWaterVolume(LuxWater_WaterVolume item, Camera triggerCam)
        {
            DoUnderWaterRendering = true;
            int index = RegisteredWaterVolumes.IndexOf(item);

            if (index != activeWaterVolume)
            {
                activeWaterVolume = index;

                WaterSurfacePos = WaterTransforms[activeWaterVolume].position.y;

                //	Update Transparents
                for (int i = 0; i < m_aboveWatersurface.Count; i++)
                {
                    m_aboveWatersurface[i].renderQueue = 2997;                     // 2998
                }
                for (int i = 0; i < m_belowWatersurface.Count; i++)
                {
                    m_belowWatersurface[i].renderQueue = 3001;
                }
            }

            if (!activeWaterVolumeCameras.Contains(triggerCam))
            {
                activeWaterVolumeCameras.Add(triggerCam);
            }
        }
예제 #4
0
        public void RegisterWaterVolume(LuxWater_WaterVolume item, bool visible)
        {
            RegisteredWaterVolumes.Add(item);
            WaterMeshes.Add(item.WaterVolumeMesh);
            WaterMaterials.Add(item.transform.GetComponent <Renderer>().sharedMaterial);
            WaterTransforms.Add(item.transform);

            WaterIsOnScreen.Add(visible);
        }
        public void DeRegisterWaterVolume(LuxWater_WaterVolume item)
        {
            int num = this.RegisteredWaterVolumes.IndexOf(item);

            if (this.activeWaterVolume == num)
            {
                this.activeWaterVolume = -1;
            }
            this.RegisteredWaterVolumes.RemoveAt(num);
            this.WaterMeshes.RemoveAt(num);
            this.WaterMaterials.RemoveAt(num);
            this.WaterTransforms.RemoveAt(num);
        }
        private void OnTriggerEnter(Collider other)
        {
            LuxWater_WaterVolumeTrigger component = (LuxWater_WaterVolumeTrigger)((Component)other).GetComponent <LuxWater_WaterVolumeTrigger>();

            if (!Object.op_Inequality((Object)component, (Object)null) || !Object.op_Inequality((Object)this.waterrendermanager, (Object)null) || (!this.readyToGo || !component.active))
            {
                return;
            }
            this.waterrendermanager.EnteredWaterVolume(this, this.ID, component.cam, this.GridSize);
            if (LuxWater_WaterVolume.OnEnterWaterVolume == null)
            {
                return;
            }
            LuxWater_WaterVolume.OnEnterWaterVolume();
        }
예제 #7
0
        public void DeRegisterWaterVolume(LuxWater_WaterVolume item)
        {
            int index = RegisteredWaterVolumes.IndexOf(item);

            if (activeWaterVolume == index)
            {
                activeWaterVolume = -1;
            }

            RegisteredWaterVolumes.RemoveAt(index);
            WaterMeshes.RemoveAt(index);
            WaterMaterials.RemoveAt(index);
            WaterTransforms.RemoveAt(index);

            WaterIsOnScreen.RemoveAt(index);
        }
예제 #8
0
        public void RegisterWaterVolume(
            LuxWater_WaterVolume item,
            int ID,
            bool visible,
            bool SlidingVolume)
        {
            this.RegisteredWaterVolumesIDs.Add(ID);
            this.RegisteredWaterVolumes.Add(item);
            this.WaterMeshes.Add(item.WaterVolumeMesh);
            this.WaterMaterials.Add(((Renderer)((Component)((Component)item).get_transform()).GetComponent <Renderer>()).get_sharedMaterial());
            this.WaterTransforms.Add(((Component)item).get_transform());
            this.WaterIsOnScreen.Add(visible);
            this.WaterUsesSlidingVolume.Add(SlidingVolume);
            int index = this.WaterMaterials.Count - 1;

            Shader.SetGlobalTexture(this.Lux_UnderWaterCausticsPID, this.WaterMaterials[index].GetTexture(this.CausticTexPID));
            this.SetGerstnerWaves(index);
        }
        public void LeftWaterVolume(LuxWater_WaterVolume item)
        {
            this.DoUnderWaterRendering = false;
            int num = this.RegisteredWaterVolumes.IndexOf(item);

            if (this.activeWaterVolume == num)
            {
                this.activeWaterVolume = -1;
                for (int i = 0; i < this.m_aboveWatersurface.Count; i++)
                {
                    this.m_aboveWatersurface[i].renderQueue = 3000;
                }
                for (int j = 0; j < this.m_belowWatersurface.Count; j++)
                {
                    this.m_belowWatersurface[j].renderQueue = 2998;
                }
            }
        }
        public void EnteredWaterVolume(LuxWater_WaterVolume item)
        {
            this.DoUnderWaterRendering = true;
            int num = this.RegisteredWaterVolumes.IndexOf(item);

            if (num != this.activeWaterVolume)
            {
                this.activeWaterVolume = num;
                this.WaterSurfacePos   = this.WaterTransforms[this.activeWaterVolume].position.y;
                for (int i = 0; i < this.m_aboveWatersurface.Count; i++)
                {
                    this.m_aboveWatersurface[i].renderQueue = 2998;
                }
                for (int j = 0; j < this.m_belowWatersurface.Count; j++)
                {
                    this.m_belowWatersurface[j].renderQueue = 3001;
                }
            }
        }
예제 #11
0
        public void DeRegisterWaterVolume(LuxWater_WaterVolume item, int ID)
        {
            int index = this.RegisteredWaterVolumesIDs.IndexOf(ID);

            if (this.activeWaterVolume == index)
            {
                this.activeWaterVolume = -1;
            }
            if (index == -1)
            {
                return;
            }
            this.RegisteredWaterVolumesIDs.RemoveAt(index);
            this.RegisteredWaterVolumes.RemoveAt(index);
            this.WaterMeshes.RemoveAt(index);
            this.WaterMaterials.RemoveAt(index);
            this.WaterTransforms.RemoveAt(index);
            this.WaterIsOnScreen.RemoveAt(index);
            this.WaterUsesSlidingVolume.RemoveAt(index);
        }
예제 #12
0
 public void LeftWaterVolume(LuxWater_WaterVolume item, int ID, Camera triggerCam)
 {
     this.DoUnderWaterRendering = false;
     if (this.activeWaterVolume == this.RegisteredWaterVolumesIDs.IndexOf(ID))
     {
         this.activeWaterVolume = -1;
         for (int index = 0; index < this.m_aboveWatersurface.Count; ++index)
         {
             this.m_aboveWatersurface[index].set_renderQueue(3000);
         }
         for (int index = 0; index < this.m_belowWatersurface.Count; ++index)
         {
             this.m_belowWatersurface[index].set_renderQueue(2997);
         }
     }
     if (!this.activeWaterVolumeCameras.Contains(triggerCam))
     {
         return;
     }
     this.activeWaterVolumeCameras.Remove(triggerCam);
 }
예제 #13
0
        public void LeftWaterVolume(LuxWater_WaterVolume item, Camera triggerCam)
        {
            DoUnderWaterRendering = false;
            int index = RegisteredWaterVolumes.IndexOf(item);

            if (activeWaterVolume == index)
            {
                activeWaterVolume = -1;
                //	Update Transparents
                for (int i = 0; i < m_aboveWatersurface.Count; i++)
                {
                    m_aboveWatersurface[i].renderQueue = 3000;
                }
                for (int i = 0; i < m_belowWatersurface.Count; i++)
                {
                    m_belowWatersurface[i].renderQueue = 2997;                     // 2998
                }
            }

            if (activeWaterVolumeCameras.Contains(triggerCam))
            {
                activeWaterVolumeCameras.Remove(triggerCam);
            }
        }
예제 #14
0
        public void SetWaterInvisible(LuxWater_WaterVolume item)
        {
            int index = RegisteredWaterVolumes.IndexOf(item);

            WaterIsOnScreen[index] = false;
        }