public override bool FindAllComponents() { try { #region Canvas var canvasGameObject = gameObject.GetComponentInChildren <Canvas>()?.gameObject; if (canvasGameObject == null) { QuickLogger.Error("Canvas cannot be found"); return(false); } #endregion #region Home var home = InterfaceHelpers.FindGameObject(canvasGameObject, "Home"); #endregion #region Powered Off Page var poweredOffPage = InterfaceHelpers.FindGameObject(canvasGameObject, "PoweredOff"); #endregion #region ColorPickerPage var colorPickerPage = InterfaceHelpers.FindGameObject(canvasGameObject, "ColorPage"); #endregion #region OpenRackBTNButton var openRackBTN = InterfaceHelpers.FindGameObject(home, "OpenBTN"); InterfaceHelpers.CreateButton(openRackBTN, "OpenBTN", InterfaceButtonMode.Background, OnButtonClick, _startColor, _hoverColor, MAX_INTERACTION_DISTANCE, AuxPatchers.OpenServerRackPage()); #endregion #region CloseRackBTNButton var closeBTN = InterfaceHelpers.FindGameObject(home, "CloseBTN"); InterfaceHelpers.CreateButton(closeBTN, "CloseBTN", InterfaceButtonMode.Background, OnButtonClick, _startColor, _hoverColor, MAX_INTERACTION_DISTANCE, AuxPatchers.CloseServerRackPage()); #endregion #region ColorPickerBTN var colorPickerBTN = InterfaceHelpers.FindGameObject(home, "ColorPicker"); InterfaceHelpers.CreateButton(colorPickerBTN, "ColorPickerBTN", InterfaceButtonMode.Background, OnButtonClick, _startColor, _hoverColor, MAX_INTERACTION_DISTANCE, AuxPatchers.ColorPage()); #endregion #region ColorPickerMainHomeBTN var colorPickerHomeBTN = InterfaceHelpers.FindGameObject(colorPickerPage, "HomeBTN"); InterfaceHelpers.CreateButton(colorPickerHomeBTN, "HomeBTN", InterfaceButtonMode.Background, OnButtonClick, _startColor, _hoverColor, MAX_INTERACTION_DISTANCE, AuxPatchers.GoToHome()); #endregion #region ColorPage _colorPickerPage.SetupGrid(20, DSSModelPrefab.ColorItemPrefab, colorPickerPage, OnButtonClick, _startColor, _hoverColor); #endregion #region AddServerBTN var addServerBTN = InterfaceHelpers.FindGameObject(home, "AddServerBTN"); InterfaceHelpers.CreateButton(addServerBTN, "AddServerBTN", InterfaceButtonMode.Background, OnButtonClick, _startColor, _hoverColor, MAX_INTERACTION_DISTANCE, AuxPatchers.AddServer()); #endregion _counter = InterfaceHelpers.FindGameObject(home, "Counter")?.GetComponent <Text>(); var poweredOffMessage = InterfaceHelpers.FindGameObject(poweredOffPage, "Text")?.GetComponent <Text>(); poweredOffMessage.text = AuxPatchers.PoweredOff(); return(true); } catch (Exception e) { QuickLogger.Error($"{e.Message} || {e.StackTrace}"); return(false); } }