예제 #1
0
 // Use this for initialization
 void Start()
 {
     m_gridManager       = FindObjectOfType <GridManager>();
     m_visualGridManager = FindObjectOfType <VisualGridManager>();
     m_gameplayManager   = FindObjectOfType <GameplayManager>();
     m_wireVisualManager = FindObjectOfType <WireVisualManager>();
 }
    // Use this for initialization
    void Start()
    {
        SetupStartingLevels();

        //Get Components
        gridManager                 = FindObjectOfType <GridManager>();
        wireVisualManager           = FindObjectOfType <WireVisualManager>();
        wireManager                 = FindObjectOfType <WireManager>();
        visualGridManager           = FindObjectOfType <VisualGridManager>();
        levelSelectButtonsGenerator = FindObjectOfType <LevelSelectButtonsGenerator>();
        levelButtonGenerator        = FindObjectOfType <LevelButtonGenerator>();

        //Do Debug Logic
        if (debug_StartGameOnLoad)
        {
            StartGame("");
        }

        //Hide GridModeIndicator
        Color startColour = gridModeIndicator.GetComponent <Text>().color;

        startColour.a = 0.0f;
        gridModeIndicator.GetComponent <Text>().color = startColour;

        actualBackgroundColour  = backgroundColour;
        orginalBackgroundColour = backgroundColour;
    }
예제 #3
0
    // Methods
    public virtual new void OnPointerDown(PointerEventData _eventData)
    {
        //Check for null Transform
        if (_eventData.button == PointerEventData.InputButton.Left)
        {
            if (m_rectTransform == null || m_canvas == null || m_visualGate == null || m_visualGridManager == null || m_gameplayManager == null || m_wireManager == null || m_infoPopup == null)
            {
                m_rectTransform     = GetComponent <RectTransform>();
                m_visualGate        = GetComponent <VisualGate>();
                m_canvas            = FindObjectOfType <Canvas>();
                m_visualGridManager = FindObjectOfType <VisualGridManager>();
                m_gameplayManager   = FindObjectOfType <GameplayManager>();
                m_wireManager       = FindObjectOfType <WireManager>();
                m_infoPopup         = FindObjectOfType <InfoPopup>();
            }
            if (m_rectTransform != null && m_canvas != null && m_visualGate != null && m_visualGridManager != null && m_gameplayManager != null && m_wireManager != null)
            {
                if (!m_wireManager.IsInWireEditMode())
                {
                    DoStateTransition(SelectionState.Pressed, false);
                    m_isBeingDragged = true;
                    m_rectTransform.SetParent(m_gameplayManager.gridParent);

                    StartCoroutine(OnDrag());
                }
            }
        }
    }
예제 #4
0
    public override void OnPointerEnter(PointerEventData eventData)
    {
        base.OnPointerEnter(eventData);

        if (m_infoPopup == null || m_visualGridManager == null || m_visualGate == null)
        {
            m_infoPopup         = FindObjectOfType <InfoPopup>();
            m_visualGridManager = FindObjectOfType <VisualGridManager>();
            m_visualGate        = GetComponent <VisualGate>();
        }

        if (m_infoPopup != null)
        {
            if (m_infoPopup.SetText(m_visualGate.titleText, m_visualGate.descriptionText))
            {
                m_isHighlighted = true;
                StartCoroutine(OnHighlight());
            }
        }
    }
 // Use this for initialization
 void Start()
 {
     wireManager       = FindObjectOfType <WireManager>();
     visualGridManager = FindObjectOfType <VisualGridManager>();
     gridManager       = FindObjectOfType <GridManager>();
 }