예제 #1
0
    public static int RecalculateClipping(IntPtr l)
    {
        int result;

        try
        {
            IClippable clippable = (IClippable)LuaObject.checkSelf(l);
            clippable.RecalculateClipping();
            LuaObject.pushValue(l, true);
            result = 1;
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }
예제 #2
0
        /// <summary>
        ///
        /// <para>
        /// Notify all IClippables under the given component that they need to recalculate clipping.
        /// </para>
        ///
        /// </summary>
        /// <param name="mask"/>
        public static void Notify2DMaskStateChanged(Component mask)
        {
            List <Component> list = ListPool <Component> .Get();

            mask.GetComponentsInChildren <Component>(list);
            for (int index = 0; index < list.Count; ++index)
            {
                if (!((Object)list[index] == (Object)null) && !((Object)list[index].gameObject == (Object)mask.gameObject))
                {
                    IClippable clippable = list[index] as IClippable;
                    if (clippable != null)
                    {
                        clippable.RecalculateClipping();
                    }
                }
            }
            ListPool <Component> .Release(list);
        }
예제 #3
0
        /// <summary>
        /// <para>Notify all IClippables under the given component that they need to recalculate clipping.</para>
        /// </summary>
        /// <param name="mask"></param>
        public static void Notify2DMaskStateChanged(Component mask)
        {
            List <Component> results = ListPool <Component> .Get();

            mask.GetComponentsInChildren <Component>(results);
            for (int i = 0; i < results.Count; i++)
            {
                if ((results[i] != null) && (results[i].gameObject != mask.gameObject))
                {
                    IClippable clippable = results[i] as IClippable;
                    if (clippable != null)
                    {
                        clippable.RecalculateClipping();
                    }
                }
            }
            ListPool <Component> .Release(results);
        }