Пример #1
0
 public virtual void Init(ParameterMetadata parameterMetadata, string type, object value, VerticalLayoutGroup layoutGroupToBeDisabled, GameObject canvasRoot, OnChangeParameterHandlerDelegate onChangeParameterHandler, bool linkable = true)
 {
     InitDropdown(layoutGroupToBeDisabled, canvasRoot);
     ParameterMetadata = parameterMetadata;
     SetType(type, linkable, false);
     this.onChangeParameterHandler = onChangeParameterHandler;
 }
Пример #2
0
 public void SetOnValueChanged(OnChangeParameterHandlerDelegate onChangeParameterHandler)
 {
     this.onChangeParameterHandler = onChangeParameterHandler;
 }
Пример #3
0
    public override void Init(ParameterMetadata parameterMetadata, string type, object value, VerticalLayoutGroup layoutGroupToBeDisabled, GameObject canvasRoot, OnChangeParameterHandlerDelegate onChangeParameterHandler, bool linkable = true)
    {
        Parameter = DropdownParameter;

        base.Init(parameterMetadata, type, value, layoutGroupToBeDisabled, canvasRoot, onChangeParameterHandler, linkable);

        SetOnValueChanged(onChangeParameterHandler);
        SetValue(value);
    }
Пример #4
0
 public void SetOnValueChanged(OnChangeParameterHandlerDelegate onChangeParameterHandler)
 {
     //input.Input.Input.onValueChanged.AddListener((string newValue)
     //        => onChangeParameterHandler(actionParameterMetadata.Name, newValue, type));
     this.onChangeParameterHandler = onChangeParameterHandler;
 }
Пример #5
0
    public override void Init(ParameterMetadata parameterMetadata, string type, object value, VerticalLayoutGroup layoutGroupToBeDisabled, GameObject canvasRoot, OnChangeParameterHandlerDelegate onChangeParameterHandler, bool linkable = true)
    {
        Parameter = Input;
        base.Init(parameterMetadata, type, value, layoutGroupToBeDisabled, canvasRoot, onChangeParameterHandler, linkable);

        SetOnValueChanged(onChangeParameterHandler);
        SetValue(value);
        //object v = value;

        /*switch (type) {
         *  case "string":
         *      if (value == null)
         *          v = parameterMetadata.GetDefaultValue<string>();
         *      break;
         *  case "integer":
         *      if (value == null)
         *          v = parameterMetadata.GetDefaultValue<int>();
         *      break;
         *  case "double":
         *      if (value == null)
         *          v = parameterMetadata.GetDefaultValue<double>();
         *      break;
         *  case "link":
         *      if (value == null)
         *          v = null;
         *      break;
         *  default:
         *      v = null;
         *      break;
         * }*/
    }
 public override void Init(ParameterMetadata parameterMetadata, string type, object value, VerticalLayoutGroup layoutGroupToBeDisabled, GameObject canvasRoot, OnChangeParameterHandlerDelegate onChangeParameterHandler, bool linkable = true)
 {
     Parameter = SwitchComponent;
     base.Init(parameterMetadata, type, value, layoutGroupToBeDisabled, canvasRoot, onChangeParameterHandler, linkable);
     SwitchComponent.AddOnValueChangedListener((bool v) => onChangeParameterHandler(parameterMetadata.Name, v, parameterMetadata.Type));
     SetValue(value);
 }