Пример #1
0
        // Function to choose the view to show
        protected void DoRouting()
        {
            // First disable all the views
            if (routerMode == RouterMode.Disable)
            {
                Disable();
            }
            else if (routerMode == RouterMode.Hide)
            {
                Hide();
            }
            else
            {
                Erase();
            }

            // By default the route is the default view
            REcanvas canvas = defaultRouteCanvas;

            // If other default view is set, that will be
            if (!String.IsNullOrEmpty(defaultRoute))
            {
                if (routes.ContainsKey(defaultRoute))
                {
                    canvas = routes[defaultRoute];
                }
            }

            // Is the route requested exist, that will be
            var peek = "Default";

            if (statesQueue.Count() > 0)
            {
                peek = statesQueue.Peek();
                if (routes.ContainsKey(statesQueue.Peek()))
                {
                    canvas = routes[statesQueue.Peek()];
                }
            }


            try
            {
                // Show the view if is hidded or disabled
                canvas.Draw();
                canvas.Enable();
                canvas.Show();

                if (inDontDestroyOnLoad)
                {
                    canvas.ToDontDestroyOnLoad();
                }
            }
            catch (Exception e)
            {
                Debug.LogError("ReactorRouter: Error while rounting to :" + peek + " , " + e);
            }
        }
Пример #2
0
        public static void EraseByPattern(string pattern)
        {
            var allCanvas = REcanvas.Find(pattern);

            for (int i = 0; i < allCanvas.Length; i++)
            {
                allCanvas[i]?.Erase();
            }
        }
Пример #3
0
        public static void EraseAll()
        {
            var allCanvas = REcanvas.Find();

            for (int i = 0; i < allCanvas.Length; i++)
            {
                allCanvas[i]?.Erase();
            }
        }