Example #1
0
        private void _render()
        {
            if (_active)
            {
                List <string> tags = new List <string> ();
                parsePath(tags, _route);

                foreach (UIElementNode node in _nodes)
                {
                    node.Hide();
                }

                for (int i = 0; i < tags.Count; i++)
                {
                    if (_cache.ContainsKey(tags[i]))
                    {
                        foreach (UIElementNode listener in _cache[tags[i]])
                        {
                            listener.Show();

                            if (listener.GetType() == typeof(UIRouter))
                            {
                                UIRouter router = (UIRouter)listener;

                                router.Route = _buildContextualRoute(tags, i);
                            }
                        }
                    }
                }

                this.Digest();
            }
        }
Example #2
0
        private string _buildPath(UIRouter router)
        {
            string code = "{current}/";

            int crnt = ChangeRoute.IndexOf(code);

            if (crnt == 0)
            {
                string nwPath = ChangeRoute.Substring(code.Length, ChangeRoute.Length - code.Length);
                return(router.Route + '/' + nwPath);
            }
            else
            {
                return(ChangeRoute);
            }
        }
Example #3
0
        void Start()
        {
            btn.onClick.AddListener(() => {
                UIRouter router = Router;

                if (TargetRouter != null)
                {
                    router = TargetRouter;
                }

                router.Route = _buildPath(router);

                if (HideOnClick)
                {
                    Hide();
                }
            });
        }