public TaskAttribute(String attributeName,TaskAttributeType attributeType,String startValue, MonoBehaviour reciver, String functionName){
		AttributeType = attributeType;
		AttributeName = attributeName;
		Value = startValue;
		eventDelegate = new EventDelegate (reciver, functionName);
		if (eventDelegate.parameters.Length != 1) {
			Debug.LogError(reciver+": Function needs 1 parameter to recive input.");
		}
	}
        public TaskAttribute(EventTask task, string key, string value, TaskAttributeType type)
        {
            if (task == null)
            {
                throw new ArgumentNullException(nameof(task));
            }

            if (String.IsNullOrWhiteSpace(key))
            {
                throw new ArgumentException("Cannot be null, emtpy or whitespate.", nameof(key));
            }

            if (String.IsNullOrWhiteSpace(value))
            {
                throw new ArgumentException("Cannot be null, emtpy or whitespate.", nameof(value));
            }

            this.Task  = task;
            this.Key   = key;
            this.Value = value;
            this.Type  = type;
        }
Exemple #3
0
	public virtual TaskAttribute addAttribute(string attributeName,TaskAttributeType t,string defaultValue, string functionName){
		TaskAttribute ta = new TaskAttribute (attributeName, t, defaultValue, this, functionName);
		attributes.Add (ta);
		return ta;
	}