public void Start() { Debug.Log("Starting outputs manager"); List <FSOutput> outputModes = GetAvailableOutputs(); Type outputModeType = typeof(FSOutput2D); bool found = false; for (int i = outputModes.Count - 1; i >= 0; i--) { FSOutput o = outputModes[i]; o.OnPreactivate += OnOutputPreactivate; o.OnActivated += OnOutputActivated; if (o.enabled) { o.enabled = false; } if (o.GetType() == outputModeType) { o.enabled = true; found = true; } else if (i == 0 && !found) { o.enabled = true; } o.OnDesactivated += OnOutputModeDesactivated; } }
void OnOutputActivated(FSOutput outputMode) { Manager.SetSetting("OutputModeType", outputMode.GetType()); if (CamerasManager.Active != null) { outputMode.UpdateCamera(CamerasManager.Active); } Active = outputMode; clearDisplay = true; }