Ejemplo n.º 1
0
        void AcquireComponents()
        {
            if (!reflection)
            {
                if (transform.parent)
                {
                    reflection = transform.parent.GetComponent <PlanarReflectionSM>();
                }
                else
                {
                    reflection = transform.GetComponent <PlanarReflectionSM>();
                }
            }

            if (!waterBase)
            {
                if (transform.parent)
                {
                    waterBase = transform.parent.GetComponent <WaterBaseSM>();
                }
                else
                {
                    waterBase = transform.GetComponent <WaterBaseSM>();
                }
            }
        }
Ejemplo n.º 2
0
        public void Update()
        {
            if (!m_WaterBase)
            {
                m_WaterBase = (WaterBaseSM)gameObject.GetComponent(typeof(WaterBaseSM));
            }

            if (specularLight && m_WaterBase.sharedMaterial)
            {
                m_WaterBase.sharedMaterial.SetVector("_WorldLightDir", specularLight.transform.forward);
            }
        }
Ejemplo n.º 3
0
 public void Start()
 {
     m_WaterBase = (WaterBaseSM)gameObject.GetComponent(typeof(WaterBaseSM));
 }