/// <summary> /// This method should be subscribed to the OnPrefabSelecdedChanged in the Ability Viewer. /// It updates the references to the selected Prefab, and the Current Selected Ability (Model). /// </summary> /// <param name="newPrefab">The New Prefab Selected</param> private void OnCurrentSelectedChanged(AbilityDesignerItem newPrefab) { // Update the Prefab selected currentPrefabSelected = newPrefab; // Update the Model based on which Prefab was selected. CurrentSelected = currentPrefabSelected.AbilityRepresented; // Make sure to update all properties so that the UI reflects the new changes. UpdateAllProperties(); }
/// <summary> /// This method should be called by the AbilityDesignerItem when it is clicked. /// It updates the reference to the Currently Selected Ability. /// </summary> /// <param name="currentPrefab">The prefab that was just selected</param> public void UpdateDesignerSelected(AbilityDesignerItem currentPrefab) { // Update the reference CurrentSelected = currentPrefab.AbilityRepresented; // Broadcast the change if (OnSelectedPrefabChanged != null) { OnSelectedPrefabChanged.Invoke(currentPrefab); } }