// Start is called before the first frame update void Start() { // Unity interal event handling SceneManager.sceneLoaded += onSceneLoaded; // create objects not tied to unity fileManager = new FileManager(this); syncBox = new NonUnitySyncbox(this); onKey = new ConcurrentQueue <Action <string, bool> >(); // load system configuration file // TODO: function string text = System.IO.File.ReadAllText(System.IO.Path.Combine(fileManager.ConfigPath(), SYSTEM_CONFIG)); lock (configLock) { systemConfig = FlexibleConfig.LoadFromText(text); } // Get all configuration files string configPath = fileManager.ConfigPath(); string[] configs = Directory.GetFiles(configPath, "*.json"); if (configs.Length < 2) { // TODO: notify ShowWarning("Configuration File Error", 5000); DoIn(new EventBase(Quit), 5000); } JArray exps = new JArray(); for (int i = 0, j = 0; i < configs.Length; i++) { Debug.Log(configs[i]); if (!configs[i].Contains(SYSTEM_CONFIG)) { exps.Add(Path.GetFileNameWithoutExtension(configs[i])); } j++; } ChangeSetting("availableExperiments", exps); // Syncbox interface if (!(bool)GetSetting("isTest")) { syncBox.Init(); } // Start experiment Launcher scene mainEvents.Do(new EventBase(LaunchLauncher)); eventsPerFrame = (int)(GetSetting("eventsPerFrame") ?? 5); }