public IEnumerator GenerateControlsIntoAWidgetViewCorrectly(int columnIndex, string controlType) { // Arrange SettingsControlView controlViewPrefab = ((GameObject)Resources.Load(CONTROL_VIEW_PREFAB_PATH.Replace("{controlType}", controlType))).GetComponent <SettingsControlView>(); SettingsControlModel newControlConfig = ScriptableObject.CreateInstance <SettingsControlModel>(); newControlConfig.title = $"TestControl_Col{columnIndex}"; newControlConfig.controlPrefab = controlViewPrefab; newControlConfig.controlController = ScriptableObject.CreateInstance <SettingsControlController>(); newControlConfig.flagsThatDeactivateMe = new List <BooleanVariable>(); newControlConfig.flagsThatDisableMe = new List <BooleanVariable>(); newControlConfig.isBeta = false; controlColumnsToCreate[columnIndex].controls.Add(newControlConfig); // Act widgetView.Initialize("TestWidget", widgetController, controlColumnsToCreate); yield return(null); // Assert widgetController.Received(1).AddControl( Arg.Any <ISettingsControlView>(), Arg.Any <SettingsControlController>(), Arg.Any <SettingsControlModel>()); }
public void CreateControls() { GoBackButton = CreateIconButton <Button>("\xE72B"); GoBackButton.Click += OnGoBackButtonClick; FavoriteButton = CreateIconButton <Button>("\xE8F1"); FavoriteButton.Click += OnFavoriteButtonClick; var v = new SettingsControlView(); LeftControls.AddRange(new IControl[] { GoBackButton, FavoriteButton, v }); }