Exemplo n.º 1
0
 private void OnWillRenderObject()
 {
     this.frame++;
     if (this.frame == RenderProxy.globalFrame)
     {
         return;
     }
     RenderProxy.globalFrame = this.frame;
     if (WaterEngine.RenderCameras != null)
     {
         WaterEngine.RenderCameras();
     }
 }
Exemplo n.º 2
0
        private void Update()
        {
            Water water = WaterEngine.WaterAt(base.transform.position);

            if (water)
            {
                Vector3 position = base.transform.position;
                if (this.useHeight)
                {
                    float b = water.HeightAt(base.transform.position);
                    position.y = Mathf.Lerp(position.y, b, this.DeltaTime / this.smoothTime);
                    base.transform.position = position;
                }
                if (this.useNormal)
                {
                    base.transform.up = Vector3.Lerp(base.transform.up, water.NormalAt(position), this.DeltaTime / this.smoothTime);
                }
            }
        }