using System; using System.Collections; using System.Globalization; using System.IO; using UnityEngine; using UnityEngine.SceneManagement; namespace Luneraria.View.Tests { static class PlayModeSupport { public const string Scene = "G1_Map"; public static string Root { get { return Path.GetDirectoryName(Application.dataPath); } } /// /// Evidence folder of a run: docs/port/<kind>/<milestone>. LUNE_EVIDENCE replaces the milestone /// name, so a later run (u2a-batch) keeps the milestone's records. /// public static string Evidence(string kind, string milestone) { string name = Environment.GetEnvironmentVariable("LUNE_EVIDENCE"); return Path.Combine(Root, "docs/port", kind, string.IsNullOrEmpty(name) ? milestone : name); } /// The G1 scene with its match running at once, without the start screen (U4). public static IEnumerator Load() { LuneMatchDriver.DirectStart = true; AsyncOperation loading = SceneManager.LoadSceneAsync(Scene, LoadSceneMode.Single); while (!loading.isDone) yield return null; yield return null; } public static string Number(double value) { return value.ToString("0.###", CultureInfo.InvariantCulture); } } }