Ejemplo n.º 1
0
        private void CleanUp()
        {
            foreach (RenderTexture rt in ReflRenderTextures.Values)
            {
                if (rt == null)
                {
                    continue;
                }
                rt.Release();
                PUtilities.DestroyObject(rt);
            }

            foreach (Camera cam in ReflCameras.Values)
            {
                if (cam == null)
                {
                    continue;
                }
                PUtilities.DestroyGameobject(cam.gameObject);
            }

            if (mesh != null)
            {
                PUtilities.DestroyObject(mesh);
            }

            if (spline != null)
            {
                spline.Dispose();
            }
        }
Ejemplo n.º 2
0
 private void Update()
 {
     if (Water == null)
     {
         PUtilities.DestroyGameobject(gameObject);
     }
 }
Ejemplo n.º 3
0
        private void Update()
        {
            for (int i = 0; i < ObsoletedGameObject.Count; ++i)
            {
                GameObject o = ObsoletedGameObject[i];
                if (o != null)
                {
                    PUtilities.DestroyGameobject(o);
                }
            }
            ObsoletedGameObject.Clear();

            SetUpSelfLayer();
            SetUpDummyComponents();

            if (MeshType == PWaterMeshType.TileablePlane && TilesFollowMainCamera && Camera.main != null)
            {
                SnapPosition(Camera.main.transform.position);
            }
        }