示例#1
0
文件: CProp.cs 项目: dvochin/Scripts
 public static void SetValueGUI(CUIWidget oUIWidget, string sNameProp, float nValue)
 {
     // Important function called by CProp to update the GUI value of whatever control it's connected to...
     if (oUIWidget != null)              //####CLEANUP?
         oUIWidget.SetValue(nValue);
 }
示例#2
0
文件: CProp.cs 项目: dvochin/Scripts
    //---------------------------------------------------------------------------	GUI
    public int CreateWidget(CPropGroup oPropGrp)
    {
        if ((_nPropFlags & CProp.Hide) != 0) 							// We don't show in GUI properties marked as hidden... these can only be changed through code.
            return 0;

        if (_oTypeChoice != null) {

            FieldInfo[] aFieldsEnum = _oTypeChoice.GetFields();
            _oUIWidget = CUIDropdown.Create(oPropGrp._oUIPanel, this, aFieldsEnum);

        }
        else if ((_nPropFlags & CProp.AsCheckbox) != 0) {

            _oUIWidget = CUIToggle.Create(oPropGrp._oUIPanel, this);

        }
        else if ((_nPropFlags & CProp.AsButton) != 0) {

            _oUIWidget = CUIButton.Create(oPropGrp._oUIPanel, this);

        }
        else {

            _oUIWidget = CUISlider.Create(oPropGrp._oUIPanel, this);
        }
        //_oWidgetGUI.variableName = _sNameProp;			//###CHECK: Safe with spaces in-between??
        //_oWidgetGUI.label.text = _sLabel;
        //_oWidgetGUI.label.tooltip = _sDescription;

        //if (oPropGrp._nNumWidgetColumns == 1) 		// If our panel group only has a single column, every widget addition expands our height.  If not a single column group then we only have one row and we never grow (size was set during group creation)
        //	oPropGrp._oContainer.setHeight(oPropGrp._oContainer.positionAndSize.height + G.C_Gui_WidgetsHeight);

        CProp.SetValueGUI(_oUIWidget, _sLabel, PropGet());

        return 1;		//###BUG???: We should return zero on multi-controls per line but strangely I don't see problem in GUI!  Check!!
    }