using System; using System.Collections.Generic; using System.Linq; using UnityEngine; using UnityEngine.UIElements; using UnityEditor; using UnityEditor.Experimental.GraphView; namespace UnityEditor.ShaderGraph.Drawing { class BlackboardViewModel : ISGViewModel { public GraphData model { get; set; } public VisualElement parentView { get; set; } public string title { get; set; } public string subtitle { get; set; } public Dictionary propertyNameToAddActionMap { get; set; } public Dictionary defaultKeywordNameToAddActionMap { get; set; } public Dictionary builtInKeywordNameToAddActionMap { get; set; } public Tuple defaultDropdownNameToAdd { get; set; } public IGraphDataAction addCategoryAction { get; set; } public Action requestModelChangeAction { get; set; } public List categoryInfoList { get; set; } // Can't add disbled keywords, so don't need an add action public List disabledKeywordNameList { get; set; } public List disabledDropdownNameList { get; set; } public BlackboardViewModel() { propertyNameToAddActionMap = new Dictionary(); defaultKeywordNameToAddActionMap = new Dictionary(); builtInKeywordNameToAddActionMap = new Dictionary(); defaultDropdownNameToAdd = null; categoryInfoList = new List(); disabledKeywordNameList = new List(); disabledDropdownNameList = new List(); } public void ResetViewModelData() { subtitle = String.Empty; propertyNameToAddActionMap.Clear(); defaultKeywordNameToAddActionMap.Clear(); builtInKeywordNameToAddActionMap.Clear(); defaultDropdownNameToAdd = null; categoryInfoList.Clear(); disabledKeywordNameList.Clear(); disabledDropdownNameList.Clear(); requestModelChangeAction = null; } } }