void PositionWidget(ParameterWidget widget)
 {
     if (widget == null)
     {
         return;
     }
     widget.transform.SetParent(scrollViewRoot.transform);
     widget.transform.localScale = Vector3.one;
 }
 void PositionWidget(ParameterWidget widget)
 {
     if (widget == null) {
         return;
     }
     widget.transform.SetParent(scrollViewRoot.transform);
     widget.transform.localScale = Vector3.one;
        // widget.GetComponent<LayoutElement>().minWidth = vertWidth * .8f;
 }
Beispiel #3
0
 void PositionWidget(ParameterWidget widget)
 {
     if (widget == null)
     {
         return;
     }
     widget.transform.SetParent(scrollViewRoot.transform);
     widget.transform.localScale = Vector3.one;
     // widget.GetComponent<LayoutElement>().minWidth = vertWidth * .8f;
 }
Beispiel #4
0
    void SetupWidget(GameParameter parameter)
    {
        ParameterWidget widget = null;
        GameObject      toAdd  = RangeWidgetPrefab;

        if (parameter.GetType() == typeof(BoolParameter))
        {
            toAdd = BoolWidgetPrefab;
        }
        if (parameter.GetType() == typeof(StringListParameter))
        {
            toAdd = StringListPrefab;
        }
        widget = ((GameObject)Instantiate(toAdd)).GetComponent <ParameterWidget>();
        Widgets.Add(widget);
        widget.Setup(parameter);
        PositionWidget(widget);
    }
    /// <summary>
    /// Instantiate widget, attach parameter
    /// </summary>
    /// <param name="parameter"></param>
    void SetupWidget(GameParameter parameter)
    {
        ParameterWidget widget = null;
        GameObject      toAdd  = RangeWidgetPrefab;

        if (parameter.GetType() == typeof(BoolParameter))
        {
            toAdd = BoolWidgetPrefab;
        }
        if (parameter.GetType() == typeof(StringListParameter))
        {
            toAdd = StringListPrefab;
        }
        widget      = ((GameObject)Instantiate(toAdd, scrollViewRoot.transform)).GetComponent <ParameterWidget>();
        widget.name = parameter.Name + "-Widget";
        Widgets.Add(widget);
        widget.Setup(parameter);
        //PositionWidget(widget);
    }