Exemplo n.º 1
0
 private void LateUpdate()
 {
     wasStaticUpdate = false;
     if (need_update)
     {
     #if FASTWATER20_LOG
         Debug.Log("local_update");
     #endif
         need_update = false;
     }
     if (local_update)
     {
     #if UNITY_EDITOR
         TryCreateTempMaterials();
     #endif
         setter_cache.Clear();
         RenderOnAwake();
         local_update = false;
     #if UNITY_EDITOR
         //  if (!Application.isPlaying)
         { WaterYPosCacher.CLEAR_ALL();
           CalcVertexSize(); }
     #endif
     }
 }
Exemplo n.º 2
0
        public static void undoRedoPerfowrm()
        {
            if (!mainThread.Equals(System.Threading.Thread.CurrentThread))
            {
                return;
            }
        #if FASTWATER20_LOG
            Debug.Log("undoRedoPerfowrm");
        #endif

            foreach (var list in editor_cache_matcollector)
            {
                foreach (var item in list.Value)
                {
                    if (item)
                    {
                        if (Application.isPlaying)
                        {/*Destroy(item);*/
                        }
                        else
                        {
                            DestroyImmediate(item);
                        }
                    }
                }
                list.Value.Clear();
            }
            var resList = editor_cache_materials.Keys.ToArray();
            foreach (var list in editor_cache_gocollector)
            {
                foreach (var item in list.Value)
                {
                    if (item)
                    {
                        editor_cache_materials.Remove(item.goID);
                    }
                }
                list.Value.Clear();
            }
            WaterYPosCacher.CLEAR_ALL();
            foreach (var item in resList)
            {
                if (id_to_controller.ContainsKey(item) && id_to_controller[item])
                {
                    id_to_controller[item].TryCreateTempMaterials();
                }
            }

            // Debug.Log( UnityEditor.Undo.() );
        }