private void Editor_ConditionChanged(SelectorConditionEditor sender, NodeSetting.SelectorCondition value) { foreach (NodeUi nodeUi in selectedNodes) { nodeUi.Node.SetSetting(sender.Setting.type, value); } }
private MonoBehaviour CreateSettingEditor(NodeSetting setting) { if (setting.valueType == typeof(bool)) { BoolEditor editor = Instantiate <BoolEditor>(boolEditorPrefab, transform); editor.Setting = setting; editor.ValueChanged += BoolEditor_ValueChanged; return(editor); } else if (setting.valueType == typeof(int)) { IntEditor editor = Instantiate <IntEditor>(intEditorPrefab, transform); editor.Setting = setting; editor.ValueChanged += NumberEditor_ValueChanged <int>; return(editor); } else if (setting.valueType == typeof(long)) { LongEditor editor = Instantiate <LongEditor>(longEditorPrefab, transform); editor.Setting = setting; editor.ValueChanged += NumberEditor_ValueChanged <long>; return(editor); } else if (setting.valueType == typeof(float)) { FloatEditor editor = Instantiate <FloatEditor>(floatEditorPrefab, transform); editor.Setting = setting; editor.ValueChanged += NumberEditor_ValueChanged <float>; return(editor); } else if (setting.valueType == typeof(double)) { DoubleEditor editor = Instantiate <DoubleEditor>(doubleEditorPrefab, transform); editor.Setting = setting; editor.ValueChanged += NumberEditor_ValueChanged <double>; return(editor); } else if (setting.valueType == typeof(string)) { StringEditor editor = Instantiate <StringEditor>(stringEditorPrefab, transform); editor.Setting = setting; editor.ValueChanged += StringEditor_ValueChanged; return(editor); } else if (setting.valueType == typeof(NodeSetting.SelectorCondition)) { SelectorConditionEditor editor = Instantiate <SelectorConditionEditor>(selectorConditionEditorPrefab, transform); editor.Setting = setting; editor.ConditionChanged += Editor_ConditionChanged; return(editor); } else if (setting.valueType == typeof(NodeSetting.DataType)) { DataTypeEditor editor = Instantiate <DataTypeEditor>(dataTypeEditorPrefab, transform); editor.Setting = setting; editor.DataTypeChanged += Editor_DataTypeChanged; return(editor); } else { DebugUtils.Assert(false); return(null); } }