Example #1
0
    public void AuthorController(ECreatureController _type)
    {
        m_HandleController = null;

        m_Controllers.TryGetValue(_type, out m_HandleController);

        if (m_HandleController != null)
        {
            m_HandleController.OnTakeAuthority();

            if (m_CurrentAuthorityController != null)
            {
                m_CurrentAuthorityController.OnLoseAuthority();

                m_CurrentAuthorityController = m_HandleController;
            }
        }
    }
Example #2
0
    public void EnableDefaultController(EDefaultController _type, bool _enable)
    {
        m_HandleController = null;

        m_DefaultControllers.TryGetValue(_type, out m_HandleController);

        if (m_HandleController != null)
        {
            if (_enable && !m_HandleController.Enable)
            {
                m_HandleController.OnTakeAuthority();
                m_HandleController.Enable = _enable;
                return;
            }

            if (!_enable && m_HandleController.Enable)
            {
                m_HandleController.OnLoseAuthority();
                m_HandleController.Enable = _enable;
                return;
            }
        }
    }