Ejemplo n.º 1
0
    // Update is called once per frame
    void Update()
    {
        if (menuvisible | helpvisible | chooser.enabled)
        {
            return;
        }

        //処理開始
        interval += Time.deltaTime;
        if (interval > 0.1f & ready & !chooser.getEnabled())
        {
            //終了時刻よりあとの時刻か
            if (current.CompareTo(finish) > 0)
            {
                if (shadowrenderer.getMode() == UmbralShadowRenderer.RECORDMODE)
                {
                    String filename = EclipseCalendar.getDateString(start.Year, start.Month, start.Day);

                    currenteclipsedata.writeJSON(filename + ".json");
                    saveTexture(filename, result);
                    if (umbralshadow != null)
                    {
                        saveTexture(filename + "_umbra", umbralshadow);
                    }
                    return;

                    ready    = false;
                    interval = 0.0f;
                }
                else if (shadowrenderer.getMode() == UmbralShadowRenderer.PLAYMODE)
                {
                    current = new DateTime(start.Year, start.Month, start.Day, start.Hour, start.Minute, 0, DateTimeKind.Utc);
                }
            }

            clock.setTime(current);
            //影描画
            shadowrenderer.drawLines(current);

            //テクスチャに結果を描き込む
            if (shadowrenderer.getMode() == UmbralShadowRenderer.RECORDMODE)
            {
                writeResult(earthshadow, result);
            }

            //地球の昼夜を描く
            currenteclipsedata.getPositions(current, posdata);
            shadowrenderer.drawNightSide(posdata);

            earthshadow.Apply();
            //時間を一つ進める
            current = current.AddMinutes(1.0);

            interval = 0.0f;
        }

        if (Application.platform == RuntimePlatform.Android & !chooser.enabled & !helpvisible)
        {
            // エスケープキー取得
            if (Input.GetKeyDown(KeyCode.Escape))
            {
                // アプリケーション終了処理
                Application.Quit();
                return;
            }
        }
    }