// Update is called once per frame void Update() { if (Input.GetKeyDown(KeyCode.Alpha2)) { print("saving a picture of the map"); SaveImage(RTImage(cam), Data.PathScreenShot); print("saving world object map"); wOM.UpdateWOTex(); SaveToImage.SaveImage(wOM.wOTex, Data.PathWOMap); print("merging world object map into heightmap"); AddWorldObjectsToHeightMap(); print("saving visited map"); SaveImage(vMM.VisitedTex, Data.PathVisited); print("overriding visited information"); SaveImage(OverrideVisited(Data.PathHeightMap, Data.PathVisited), Data.PathHeightOverriden); SaveImage(OverrideVisited(Data.PathScreenShot, Data.PathVisited), Data.PathScreenOverriden); print("adding height map"); SaveImage(Steganography.HideImage(Data.PathScreenOverriden, Data.ScreenShotWidth, Data.ScreenShotHeight, Data.PathHeightOverriden, Data.HeightMapWidth, Data.HeightMapHeight, Data.BitsHidden), Data.PathCombined); } }
void Update() { if (Input.GetKeyDown(KeyCode.Alpha1)) { print("generating a map"); Texture2D heightMap = GenerateHeightMap(Data.HeightMapWidth, Data.HeightMapHeight); WriteHeightMapToFile(heightMap); LoadHeightmapFromFile(Data.PathHeightMap); Player.GetComponent <ResetToStart>().Reset(); vMM.ClearVisitedTex(); wOM.ClearWOTex(); wOM.RemoveAllWO(); } if (Input.GetKeyDown(KeyCode.Alpha3)) { print("loading a map"); SaveToImage.SaveImage(Steganography.RecoverImage(Data.PathCombined, Data.ScreenShotWidth, Data.ScreenShotHeight, Data.BitsHidden, Data.HeightMapWidth, Data.HeightMapHeight), Data.PathRecovered); LoadHeightmapFromFile(Data.PathRecovered); wOM.RemoveAllWO(); wOM.LoadWOFromFile(Data.PathRecovered); Player.GetComponent <ResetToStart>().Reset(); vMM.ClearVisitedTex(); } }