Esempio n. 1
0
    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();
        }
    }