コード例 #1
0
    private void UpdateUI()
    {
        bool isOverUI = PlayfieldEvents.HasEvent(PlayfieldEvents.InputEvents.CursorMoveOverUI);

        if (isOverUI && !m_IsCursorOverUI)
        {
            m_PlayfieldComponent.RemoveHiglighting();
            m_PlayfieldComponent.OverUI();
        }

        m_IsCursorOverUI = isOverUI;
    }
コード例 #2
0
    private void EditorUpdateCell()
    {
        if (!PlayfieldEvents.HasEvent(PlayfieldEvents.InputEvents.Select))
        {
            return;
        }

        if (IsValidCell(m_CurrentCell))
        {
            m_PlayfieldComponent.SetCellProperties(m_CurrentCell.x, m_CurrentCell.y, m_EditorProperties);
        }
    }
コード例 #3
0
    private void UpdateActions()
    {
        if (!PlayfieldEvents.HasEvent(PlayfieldEvents.InputEvents.Select))
        {
            return;
        }

        if (IsValidCell(m_CurrentCell))
        {
            m_PlayfieldComponent.SelectCell(m_CurrentCell.x, m_CurrentCell.y);
        }
        else
        {
            m_PlayfieldComponent.RemoveSelection();
        }
    }
コード例 #4
0
    private void UpdateLocomotion()
    {
        if (!PlayfieldEvents.HasEvent(PlayfieldEvents.InputEvents.CursorMove))
        {
            return;
        }

        m_CurrentCell = (Vector2Int)PlayfieldEvents.GetEvent(PlayfieldEvents.InputEvents.CursorMove);

        if (IsValidCell(m_CurrentCell))
        {
            m_PlayfieldComponent.HiglightCell(m_CurrentCell.x, m_CurrentCell.y);
        }
        else
        {
            m_PlayfieldComponent.RemoveHiglighting();
        }
    }
コード例 #5
0
    private void EditorUpdateSelection()
    {
        if (!PlayfieldEvents.HasEvent(PlayfieldEvents.InputEvents.CursorMove))
        {
            return;
        }

        m_CurrentCell = (Vector2Int)PlayfieldEvents.GetEvent(PlayfieldEvents.InputEvents.CursorMove);

        if (IsValidCell(m_CurrentCell))
        {
            m_PlayfieldComponent.SetEditorSelection(m_CurrentCell.x, m_CurrentCell.y);
        }

        // Update cells if MB pressed
        if (PlayfieldEvents.HasEvent(PlayfieldEvents.InputEvents.LMBPressed))
        {
            m_PlayfieldComponent.SetCellProperties(m_CurrentCell.x, m_CurrentCell.y, m_EditorProperties);
        }
    }