Пример #1
0
        private void Update()
        {
            if (m_DynamicColumn == null)
            {
                m_DynamicColumn = new DynamicValue <int>(columnGetter, m_SerializedProperty, column);
            }
            m_DynamicColumn.Update(m_SerializedProperty);
            if (columnGetter != null)
            {
                column = m_DynamicColumn.GetValue();
            }
            column = Mathf.Max(1, column);

            if (m_DynamicSize == null)
            {
                m_DynamicSize = new DynamicValue <Vector2>(cellSizeGetter, m_SerializedProperty, new Vector2(cellWidth, cellHeight));
            }
            m_DynamicSize.Update(m_SerializedProperty);
            if (cellSizeGetter != null)
            {
                var size = m_DynamicSize.GetValue();
                cellWidth  = size.x;
                cellHeight = size.y;
            }

            if (m_DynamicMaxHeight == null)
            {
                m_DynamicMaxHeight = new DynamicValue <float>(maxHeightGetter, m_SerializedProperty, maxHeight);
            }
            m_DynamicMaxHeight.Update(m_SerializedProperty);
            if (maxHeightGetter != null)
            {
                maxHeight = m_DynamicMaxHeight.GetValue();
            }
        }
Пример #2
0
        private Texture GetImage()
        {
            if (m_Image == null)
            {
                m_Image   = new DynamicValue <string>(image, m_SerializedProperty);
                m_Texture = new DynamicValue <UnityEngine.Object>(texture, m_SerializedProperty);
            }
            m_Image.Update(m_SerializedProperty);
            m_Texture.Update(m_SerializedProperty);

            var obj = m_Texture.GetValue();

            if (obj != null && obj is Texture)
            {
                return(obj as Texture);
            }

            var img = m_Image.GetValue();

            if (!string.IsNullOrEmpty(img))
            {
                var tex = GUID ? img.GUIDToImage() : img.GetImage();
                if (tex != null)
                {
                    return(tex);
                }
            }

            return(null);
        }
Пример #3
0
 private string GetMessage()
 {
     if (m_DynamicMessage == null)
     {
         m_DynamicMessage = new DynamicValue <string>(m_Message, m_SerializedProperty);
     }
     m_DynamicMessage.Update(m_SerializedProperty);
     return(m_DynamicMessage.GetValue());
 }
 public virtual string GetMessage(SerializedProperty property)
 {
     if (m_DynamicMessage == null)
     {
         m_DynamicMessage = new DynamicValue <string>(m_Message, property);
     }
     m_DynamicMessage.Update(property);
     return(m_DynamicMessage.GetValue());
 }
Пример #5
0
 protected DynamicValue <bool> GetCondition()
 {
     if (m_DynamicCondition == null)
     {
         m_DynamicCondition = new DynamicValue <bool>(m_Condition, m_SerializedProperty);
     }
     m_DynamicCondition.Update(m_SerializedProperty);
     return(m_DynamicCondition);
 }
 private DynamicValue <UnityEngine.Object> GetObjectReference()
 {
     if (m_ObjectReference == null)
     {
         m_ObjectReference = new DynamicValue <Object>("$", m_SerializedProperty);
     }
     m_ObjectReference.Update(m_SerializedProperty);
     return(m_ObjectReference);
 }
Пример #7
0
 private void Update()
 {
     if (m_DynamicMaxHeight == null)
     {
         m_DynamicMaxHeight = new DynamicValue <float>(maxHeightGetter, m_SerializedProperty, maxHeight);
     }
     m_DynamicMaxHeight.Update(m_SerializedProperty);
     if (maxHeightGetter != null)
     {
         maxHeight = m_DynamicMaxHeight.GetValue();
     }
 }
 public bool IsVisible()
 {
     if (m_ByPass == null)
     {
         m_ByPass = new DynamicValue <bool>(byPass, m_SerializedProperty);
     }
     m_ByPass.Update(m_SerializedProperty);
     if (!string.IsNullOrEmpty(byPass))
     {
         if (m_ByPass.GetValue())
         {
             return(false);
         }
     }
     return(visible);
 }
Пример #9
0
        private void Update()
        {
            if (sizeGetter == null)
            {
                return;
            }
            if (m_DynamicSize == null)
            {
                m_DynamicSize = new DynamicValue <Vector2>(sizeGetter, m_SerializedProperty, new Vector2(width, height));
            }
            m_DynamicSize.Update(m_SerializedProperty);
            var size = m_DynamicSize.GetValue();

            width  = size.x;
            height = size.y;
        }
Пример #10
0
 private void Update()
 {
     if (m_DragAction == null)
     {
         m_DragAction = new DynamicAction(drag, m_SerializedProperty);
     }
     if (m_DropAccept == null)
     {
         m_DropAccept = new DynamicValue <bool>(accept, m_SerializedProperty);
     }
     if (m_DropAction == null)
     {
         m_DropAction = new DynamicAction(drop, m_SerializedProperty);
     }
     m_DragAction.Update(m_SerializedProperty);
     m_DropAccept.Update(m_SerializedProperty);
     m_DropAction.Update(m_SerializedProperty);
 }