FairyGUI.UIPanel.SetHitTestMode C# (CSharp) Method

SetHitTestMode() public method

public SetHitTestMode ( HitTestMode value ) : void
value HitTestMode
return void
        public void SetHitTestMode(HitTestMode value)
        {
            if (this.hitTestMode != value)
            {
                this.hitTestMode = value;
                BoxCollider collider = this.gameObject.GetComponent<BoxCollider>();
                if (this.hitTestMode == HitTestMode.Raycast)
                {
                    if (collider == null)
                        collider = this.gameObject.AddComponent<BoxCollider>();
                    this.container.hitArea = new BoxColliderHitTest(collider);
                    if (_ui != null)
                        UpdateHitArea();
                }
                else
                {
                    this.container.hitArea = null;
                    if (collider != null)
                        Component.Destroy(collider);
                }
            }
        }

Usage Example

示例#1
0
 static int SetHitTestMode(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         FairyGUI.UIPanel     obj  = (FairyGUI.UIPanel)ToLua.CheckObject(L, 1, typeof(FairyGUI.UIPanel));
         FairyGUI.HitTestMode arg0 = (FairyGUI.HitTestMode)ToLua.CheckObject(L, 2, typeof(FairyGUI.HitTestMode));
         obj.SetHitTestMode(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }