//EclipseDataChooserからの変更指示 public void EclipseDataChange(int number) { clock.enabled = true; //日食データの変更を行う int year = EclipseCalendar.schedule[number][0]; int month = EclipseCalendar.schedule[number][1]; int day = EclipseCalendar.schedule[number][2]; DateTime startdate = EclipseDataHolder.getEclipseData().getStartTime(); if (year == startdate.Year & month == startdate.Month & day == startdate.Day) { return; } //Debug.Log("data number = " + number); string datafilename = EclipseCalendar.getDateString(year, month, day) + ".json"; StartCoroutine("initEclipseDataFromAssetBundle", datafilename); }
// 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; } } }