using UnityEngine; using System.Collections.Generic; using ParadoxNotion.Design; using NodeCanvas.Framework; namespace NodeCanvas.Tasks.Actions { [Category("✫ Blackboard/Dictionaries")] public class AddElementToDictionary : ActionTask { [BlackboardOnly] [RequiredField] public BBParameter> dictionary; public BBParameter key; public BBParameter value; protected override string info { get { return string.Format("{0}[{1}] = {2}", dictionary, key, value); } } protected override void OnExecute() { if ( dictionary.value == null ) { EndAction(false); return; } dictionary.value[key.value] = value.value; EndAction(); } } }