Exemplo n.º 1
0
 protected override void OnCanvasGroupChanged()
 {
     base.OnCanvasGroupChanged();
     if (!Application.isPlaying)
     {
         return;
     }
     if (_useRaycast)
     {
         var block = GetComponentInParent <CanvasGroup>().blocksRaycasts;
         raycastTarget = block;
         if (!block)
         {
             _unregistered = true;
             GraphicRegistry.UnregisterGraphicForCanvas(canvas, this);
         }
         else
         {
             if (_unregistered)
             {
                 GraphicRegistry.RegisterGraphicForCanvas(canvas, this);
             }
         }
     }
 }
Exemplo n.º 2
0
    public static int RegisterGraphicForCanvas_s(IntPtr l)
    {
        int result;

        try
        {
            Canvas c;
            LuaObject.checkType <Canvas>(l, 1, out c);
            Graphic graphic;
            LuaObject.checkType <Graphic>(l, 2, out graphic);
            GraphicRegistry.RegisterGraphicForCanvas(c, graphic);
            LuaObject.pushValue(l, true);
            result = 1;
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }