Esempio n. 1
0
    // Update is called once per frameforeach(string g in allAssetGuids.
    void Update()
    {
        if (Input.GetMouseButtonDown(0))
        {
            Debug.Log("MOUSE. Regenerate here.");
            GenerateAllFloor();
            return;
        }

        // jKey => good
        bool jKey = Input.GetKey("j");
        // kKey => bad
        bool kKey = Input.GetKey("k");
        // gKey => generate 10K images
        bool gKey = Input.GetKey("g");

        if (jKey || kKey)
        {
            string dir            = System.IO.Path.Combine(OUTPUT_DIR, jKey ? "good" : "bad");
            string outputFilename = OutputLocation(dir, "default", RoomGenUtils.CreateMD5(generatorConfig));
            CaptureScreenShot(outputFilename);

            GenerateAllFloor();
        }
        else if (gKey && !film)
        {
            film = true;
        }
    }
Esempio n. 2
0
    IEnumerator CaptureCoroutine()
    {
        string dir = System.IO.Path.Combine(OUTPUT_DIR, RoomType);

        while (true)
        {
            if (film)
            {
                var unixTimestamp = System.DateTime.UtcNow.Subtract(new System.DateTime(1970, 1, 1)).TotalMilliseconds;
                for (int i = 0; i < 1000; i++)
                {
                    string outputFilename = OutputLocation(dir, unixTimestamp.ToString(), RoomGenUtils.CreateMD5(generatorConfig));
                    CaptureScreenShot(outputFilename);
                    GenerateAllFloor();
                    yield return(new WaitForSeconds(.5f));
                }
                film = false;
            }
            yield return(new WaitForSeconds(1));
        }
    }