Пример #1
0
        /// <summary>
        /// Invoked when the tool is enabled
        /// </summary>
        protected override void OnEnable()
        {
            LoggerUtils.Log("Enabled");

            base.OnEnable();

            m_optionPanel.Show();

            m_action = m_zoningAction;
            m_action.OnEnterController();
        }
Пример #2
0
        /// <summary>
        /// Invoked when the user clicks in a option button
        /// </summary>
        /// <param name="component"></param>
        /// <param name="selectedIndex"></param>
        private void OnChangeSelectedIndex(UIComponent component, int selectedIndex)
        {
            m_action?.OnLeftController();
            var oldAction = m_action;

            switch (selectedIndex)
            {
            case 0:
                m_action = m_zoningAction;
                break;

            case 1:
                m_action = m_movingZoneAction;
                break;

            default:
                m_action = null;
                break;
            }

            m_action?.OnChangeController(oldAction);
            m_action?.OnEnterController();
        }