Ejemplo n.º 1
0
        /// <summary>
        /// Determines whether this instance has children.
        /// </summary>
        /// <returns><c>true</c> if this instance has children; otherwise, <c>false</c>.</returns>
        public bool HasChildren()
        {
            DebugEx.Verbose("TreeNode<T>.HasChildren()");

            return(mChildren != null && mChildren.Count > 0);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Stops timer.
        /// </summary>
        public void Stop()
        {
            DebugEx.Verbose("Timer.Stop()");

            mTime = TIMER_NOT_ACTIVE;
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Fits RectTransform to screen.
        /// </summary>
        /// <param name="transform">Transform.</param>
        /// <param name="width">Width.</param>
        /// <param name="height">Height.</param>
        /// <param name="x">The x coordinate.</param>
        /// <param name="y">The y coordinate.</param>
        /// <param name="left">Left edge of alternative position.</param>
        /// <param name="bottom">Bottom edge of alternative position.</param>
        /// <param name="shadowRight">Shadow right offset.</param>
        /// <param name="shadowBottom">Shadow bottom offset.</param>
        public static void FitRectTransformToScreen(
            RectTransform transform
            , float width
            , float height
            , float x            = 0f
            , float y            = 0f
            , float left         = -1f
            , float bottom       = -1f
            , float shadowRight  = 0f
            , float shadowBottom = 0f
            )
        {
            DebugEx.VeryVerboseFormat("Utils.FitRectTransformToScreen(transform = {0}, width = {1}, height = {2}, x = {3}, y = {4}, left = {5}, bottom = {6}, shadowRight = {7}, shadowBottom = {8})"
                                      , transform
                                      , width
                                      , height
                                      , x
                                      , y
                                      , left
                                      , bottom
                                      , shadowRight
                                      , shadowBottom);

            float screenWidth  = scaledScreenWidth;
            float screenHeight = scaledScreenHeight;

            if (width > screenWidth)
            {
                width = screenWidth;
            }

            if (height > screenHeight)
            {
                height = screenHeight;
            }

            if (x + width > screenWidth)
            {
                if (left != -1f)
                {
                    x = left - width + shadowRight;

                    if (x < 0f)
                    {
                        x = screenWidth - width;
                    }
                }
                else
                {
                    x = screenWidth - width;
                }
            }

            if (y + height > screenHeight)
            {
                if (bottom != -1f)
                {
                    y = bottom - height + shadowBottom;

                    if (y < 0f)
                    {
                        y = screenHeight - height;
                    }
                }
                else
                {
                    y = screenHeight - height;
                }
            }

            Utils.AlignRectTransformTopLeft(transform, width, height, x, y);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Starts timer.
        /// </summary>
        public void Start()
        {
            DebugEx.VeryVerbose("Timer.Start()");

            mTime = 0f;
        }