コード例 #1
0
        //WeatherEnclosure m_Enclosure;

        public void SetWeatherEnclosure(WeatherEnclosure enclosure)
        {
            //m_Enclosure = enclosure;

            if (rainMeshRenderer != null)
            {
                rainMeshRenderer.enabled = false;
                rainMeshRenderer         = null;
            }

            if (!enclosure)
            {
                return;
            }

            rainMeshRenderer = enclosure.GetComponentInChildren <MeshRenderer>();
            if (!rainMeshRenderer)
            {
                Debug.LogError("Can't render rain since there's no MeshRenderer on the WeatherEnclosure");
                return;
            }

            m_PropertyBlock = new MaterialPropertyBlock();

            if (!rainMaterial)
            {
                return;
            }

            rainMeshRenderer.material = rainMaterial;
            rainMeshRenderer.enabled  = true;

            UpdateForTimeOfDay(m_SkyProfile, m_TimeOfDay);
        }
コード例 #2
0
        private void OnEnclosureDidChange(WeatherEnclosure enclosure)
        {
            m_Enclosure = enclosure;
            if (m_Enclosure != null)
            {
                m_EnclosureMeshRenderer = m_Enclosure.GetComponentInChildren <MeshRenderer>();
            }

            rainDownfallController.SetWeatherEnclosure(m_Enclosure);

            UpdateForTimeOfDay(m_Profile, m_TimeOfDay);
        }
コード例 #3
0
        private void OnTriggerExit(Collider other)
        {
            WeatherEnclosure enclosure = other.gameObject.GetComponentInChildren <WeatherEnclosure>();

            if (!enclosure)
            {
                return;
            }

            if (!triggeredEnclosures.Contains(enclosure))
            {
                return;
            }

            triggeredEnclosures.Remove(enclosure);

            ApplyEnclosure();
        }