public void Setup(Presets.EditDieAssignment ass, System.Func <EditDie, bool> dieSelector) { this.editAssignment = ass; this.dieSelector = dieSelector; selectDieDropdown.onClick.AddListener(PickNewDie); selectBehaviorDropdown.onClick.AddListener(PickNewBehavior); UpdateView(); }
UIAssignmentToken CreateAssignmentToken(Presets.EditDieAssignment assignment) { var uiass = GameObject.Instantiate <UIAssignmentToken>(assignmentTokenPrefab, assignmentsRoot); uiass.Setup(assignment, (ed) => !editPreset.dieAssignments.Where(ass => ass != assignment).Any(ass => ass.die != null && ass.die.deviceId == ed.deviceId)); uiass.onChange += OnAssignmentChanged; uiass.onDelete.AddListener(() => DeleteAssignment(assignment)); return(uiass); }
void DeleteAssignment(Presets.EditDieAssignment assignment) { PixelsApp.Instance.ShowDialogBox( "Delete Assignment?", "Are you sure you want to delete this assignment?", "Yes", "Cancel", (res) => { base.pageDirty = true; editPreset.dieAssignments.Remove(assignment); RefreshView(); }); }
void OnAssignmentChanged(Presets.EditDieAssignment editAssignment) { base.pageDirty = true; RefreshView(); }
public void UpdateDieDataSet(Presets.EditDieAssignment editDieAssignment, System.Action <bool> callback) { UpdateDieDataSet(editDieAssignment.behavior, editDieAssignment.die, callback); }