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>(); } } }
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); } }
public void Start() { m_WaterBase = (WaterBaseSM)gameObject.GetComponent(typeof(WaterBaseSM)); }