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 OnOutputModeDesactivated(FSOutput outputMode) { outputMode.DetachFromCamera(); if (Active == outputMode) { Active = null; } }
void OnOutputPreactivate(FSOutput outputMode) { foreach (FSOutput om in GetAvailableOutputs()) { if (om != outputMode && om.enabled) { om.enabled = false; } } }
public FSOutput ActivateOutputMode(string id) { FSOutput newOutput = Manager.GetInstance <FSOutput>(id); if (newOutput != null) { newOutput.enabled = true; } return(newOutput); }
void OnOutputActivated(FSOutput outputMode) { Manager.SetSetting("OutputModeType", outputMode.GetType()); if (CamerasManager.Active != null) { outputMode.UpdateCamera(CamerasManager.Active); } Active = outputMode; clearDisplay = true; }