Esempio n. 1
0
        /// <summary>
        /// Gets the colour from the panel and sets it to be rendered/saved
        /// </summary>
        private void SetRoadData()
        {
            if (m_netSegmentId != 0)
            {
                string routeStr         = m_routeStrField.text;
                bool   validOldRouteStr = m_initialRouteStr != null && m_initialRoutePrefix != null;
                string oldRouteStr      = validOldRouteStr ? m_initialRoutePrefix + '/' + m_initialRouteStr : null;
                if (routeStr != null)
                {
                    RenderingManager roadRenderingManager = RenderingManager.instance;
                    RouteManager.Instance().SetRoute(m_netSegmentId, m_routeTypeDropdown.selectedValue, routeStr, oldRouteStr);

                    Hide();
                    EventBusManager.Instance().Publish("closeUsedNamePanel", null);
                    EventBusManager.Instance().Publish("forceupdateroadnames", null);
                    roadRenderingManager.ForceUpdate();
                }
            }
        }
Esempio n. 2
0
        public override void OnLevelLoaded(LoadMode mode)
        {
            if (mode == LoadMode.LoadGame || mode == LoadMode.NewGame)
            {
                UIView view = UIView.GetAView();
                UI = ToolsModifierControl.toolController.gameObject.AddComponent <MainPanel>();

                ModSettings.LoadSettings();

                m_renderingManager         = RenderingManager.instance;
                m_renderingManager.enabled = true;

                if (m_renderingManager != null && !m_renderingManager.m_registered)
                {
                    RenderManager.RegisterRenderableManager(m_renderingManager);
                    m_renderingManager.m_registered = true;
                    m_renderingManager.ForceUpdate();
                }

                MarkARouteOptions.mInGame = true;
                MarkARouteOptions.update();
            }
        }