Esempio n. 1
0
 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();
 }
Esempio n. 2
0
    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);
    }
Esempio n. 3
0
 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();
     });
 }
Esempio n. 4
0
 void OnAssignmentChanged(Presets.EditDieAssignment editAssignment)
 {
     base.pageDirty = true;
     RefreshView();
 }
Esempio n. 5
0
 public void UpdateDieDataSet(Presets.EditDieAssignment editDieAssignment, System.Action <bool> callback)
 {
     UpdateDieDataSet(editDieAssignment.behavior, editDieAssignment.die, callback);
 }