天天看點

UGUI_接口相關彙總

--------------光線投射過濾器---------

public interface ICanvasRaycastFilter
{
     bool IsRaycastLocationValid(Vector2 sp, Camera eventCamera);
}


           
-------------執行裁切功能接口---------
public interface IClipper
{
    void PreformClipping();
}

----------可裁剪功能------
public inteface IClippable
{
    GameObject gameObject{get;}
    void RecalculateRectClipping();
    RectTransform rectTransfomr{get;}
    void Cull(Rect rect,bool validRect);
    void SetClipRect(Rect value,bool validRect);
}

           
--------------透明遮罩接口---------------
public inteface IMaskable
{
    void RecalculateMasking();
}
           
------------材質修改接口--------------
public inteface MaterialModifier
{
    Material GetModifiedMaterial(Material baseMaterial);
}
           
---------------ICanvasElement布局元素的接口功能-----------------------


public interface ILayoutElement
{
    void ReBuild(CanvasUpdate executing);
    Transform transform{get};
    void LayoutComplete();
    void LayoutUpdateComplete();
    bool IsDestroy();
}
           
//Canvas 布局的狀态
public enum CanvasUpdate
{
    PreLayout,
    Layout,
    PostLayout,
    PreRender,
    LatePreRender,
    MaxUpdateValue,
}
           
-----------ICanvasElement------------
需要canvas繪制的對象都實作該接口,如text, image等
public interface ICanvasElement
{
    void ReBuild(CanvasUpdate executing)
    Transform transform{get;}
    void LayoutComplete();
    void GraphicUpdateLayout();
    bool IsDestroy();
}
           
public interface ILayoutController
{
    void SetLayoutHorizontal();
    void SetLayoutVertical();
}
           
public interface ILayoutGroup:ILayoutController
{
    
}
           
public interface ILayoutSelfController:ILayoutController
{
    
}
           
public interface ILayoutIgnorer
{
    bool ignoreLayot(get;)
}
           
public interface ILayoutElement
{
    void CalculateLayoutInputHorizontal();
    void CalculateLayoutInputVertical();
    
    float minWidth;
    float preferredWidth;
    float flexibleWidth;
    
    float minHeight;
    float preferredHeight;
    float flexibleHeight;
    
    int layoutPriority{get;};
}
           

繼續閱讀