Example #1
0
 public void Hide()
 {
     if (mFocusProperty != null && mFocusProperty.ReguexData() && mFocusDecorator != null)
     {
         mFocusDecorator.UpdatePropertiesInfo();
     }
     Visible           = false;
     Context           = null;
     Mode              = EMode.none;
     mRaycastProperty  = null;
     mFocusProperty    = null;
     mFocusDecorator   = null;
     mRaycastDecorator = null;
     mDropDownMeta     = null;
     mSearchContext    = "";
 }
Example #2
0
        void OnPropertiesList(Rect r, BehaviourNodeGUI.Decorator decorator, Vector2 tsize, Vector2 dsize)
        {
            BTInputProperty[] properties = decorator.Properties;
            if (properties.Length == 0)
            {
                return;
            }
            Rect h = new Rect();

            h.size     = new Vector2(dsize.x - 6 * GlobalScale, dsize.y);
            h.position = r.position + Vector2.one * 3 * GlobalScale;
            Installizer.contentStyle.alignment = TextAnchor.MiddleLeft;
            Installizer.contentStyle.fontSize  = (int)Mathf.Max(1, BehaviourNodeGUI.SUB_FONT_SIZE * GlobalScale);
            bool dirty = false;

            for (int i = 0; i < properties.Length; i++)
            {
                BTInputProperty prop = properties[i];
                Installizer.contentContent.text = prop.PropertyName;
                GUI.Label(h, Installizer.contentContent, Installizer.contentStyle);
                h.y += dsize.y;//  = new Vector2(r.xMin + x0, r.yMin + i * dsize.y);
                //GUI.Label(h, "", "textfield");// "TL LoopSection");
                QuickGUI.DrawBox(h, Color.clear, Color.gray, 1);
                if (h.Contains(Event.current.mousePosition))
                {
                    mRaycastProperty = prop;
                }
                if (mFocusProperty == prop)
                {
                    string str = GUI.TextField(h, prop.InputData, Installizer.contentStyle);
                    dirty         |= str != prop.InputData;
                    prop.InputData = str;
                }
                else
                {
                    prop.ReguexData();
                    GUI.Label(h, prop.IsDefaultValue ?
                              string.Format("<i><color=#a0a0a0>({0})</color></i> {1} ", prop.TypeName, prop.InputData) : prop.InputData, Installizer.contentStyle);
                }
                h.y += tsize.y;
            }
            if (dirty)
            {
                decorator.UpdatePropertiesInfo();
                mResizeNode = true;
            }
        }