Esempio n. 1
0
    public override void Construct()
    {
        m_Manager.grid.SelectableZone = m_Range;

        if (m_Range == m_Targets)
        {
            m_Next.Construct();
        }
    }
Esempio n. 2
0
    public override UpdateResult Update()
    {
        if (Next != null)
        {
            UpdateResult result = Next.Update();

            if (result == UpdateResult.Canceled)
            {
                if (m_Range == m_Targets)
                {
                    Destruct();
                }
                else
                {
                    Next = null;
                    return(UpdateResult.InProgress);
                }
            }

            return(result);
        }
        else
        {
            if (Input.GetButtonDown("Cancel"))
            {
                Destruct();
                return(UpdateResult.Canceled);
            }
            else if (Input.GetButtonDown("Submit"))
            {
                Vector2Int selection = m_Manager.grid.Selector.SelectedTile;
                if (m_Range[selection])
                {
                    m_Targets.Center = selection;
                    m_Next           = new BattleTargetConfirmMenu(m_ID, m_Targets);
                    m_Next.Construct();
                }
            }

            return(UpdateResult.InProgress);
        }
    }