/// <summary>
    /// Activates the linked panel
    /// </summary>
    /// <param name="panel"></param>
    public void ActivateLinkedPanel(Panel_Base panel)
    {
        //Always unsubscribe
        panelCalledFrom.panelDeactivatedEvent -= ActivateLinkedPanel;

        panelLinked.ActivatePanel(true);
    }
    void Deactivated(Panel_Base panel)
    {
        //Remove from subscription
        panel.panelDeactivatedEvent -= Deactivated;

        if (!activeButton)
        {
            return;
        }

        if (activeButton.linkedPanel)
        {
            if (activeButton.linkedPanel)
            {
                Debug.Log(".....................");
                activeButton.ShowPanel();
                activeButton.linkedPanel.panelActivatedEvent += ActiveButtonShown;
            }
            else
            {
                //Debug.Log("################");
                canswitch = true;
            }
        }
        else
        {
            canswitch = true;
        }
    }
    void Deactivated(Panel_Base panel)
    {
        if (activeButton.linkedPanel)
        {
            if (activeButton.linkedPanel)
            {
                activeButton.ShowPanel();
                activeButton.linkedPanel.panelActivatedEvent += ActiveButtonShown;
            }
            else
            {
                canswitch = true;
            }
        }
        else
        {
            canswitch = true;
        }

        //Remove from subscription
        if (previousActiveButton.linkedPanel)
        {
            previousActiveButton.linkedPanel.panelDeactivatedEvent -= Deactivated;
        }
    }
 void NextButtonPanelClosed(Panel_Base panel)
 {
     //Unsubscribe
     flangeBeing.Stop();
     nextButtonPanel.panelDeactivatedEvent -= NextButtonPanelClosed;
     VuforiaManager.Instance.DisableTrackerIndex(4);
     SequenceManager.Instance.GoToNextSequence();
 }
Example #5
0
    void BoardOperatorPanelDisplay(Panel_Base panel)
    {
        //Unsubscribe
        psigCheckPanel.panelDeactivatedEvent -= BoardOperatorPanelDisplay;

        //Activate the board operator panel and subscribe to it's closing event
        boardOperatorPanel.ActivatePanel(true);
        boardOperatorPanel.panelDeactivatedEvent += TimerPanelDisplay;
    }
    public void PanelClosed(Panel_Base panel)
    {
        //Unsubscribe to the panel closing event and go to next sequence
        MoveToPlatformPanel.panelDeactivatedEvent -= PanelClosed;
        VuforiaManager.Instance.DisableTrackerIndex(3);

        moveToPlatformAnimator.enabled = false;
        SequenceManager.Instance.GoToNextSequence();
    }
 void ActiveButtonShown(Panel_Base panel)
 {
     //Debug.Log("Active button has finished showing");
     //Remove from subscription
     panel.panelActivatedEvent -= ActiveButtonShown;
     //if (activeButton.linkedPanel)
     //    activeButton.linkedPanel.panelActivatedEvent -= ActiveButtonShown;
     //can only switch after the active button is shown
     canswitch = true;
 }
Example #8
0
    void TimerPanelDisplay(Panel_Base panel)
    {
        //Unsubscribe
        //boardOperatorPanel.panelDeactivatedEvent -= TimerPanelDisplay;

        //Activate timer panel and subscribe to it's deactivation event
        timerPanel.ActivatePanel(true);
        timerPanel.StartTimer(timerDuration);
        //timerPanel.panelDeactivatedEvent += TimerPanelDeactivated;
    }
 void ActiveButtonShown(Panel_Base panel)
 {
     //Remove from subscription
     if (activeButton.linkedPanel)
     {
         activeButton.linkedPanel.panelActivatedEvent -= ActiveButtonShown;
     }
     //can only switch after the active button is shown
     canswitch = true;
 }
    void ChainInstructionPanelClosed(Panel_Base panel)
    {
        //Stop the animation
        arrowAnimator.enabled = false;

        //unsubscribe and move on to the next sequence

        SequenceManager.Instance.GoToNextSequence();

        //TODO: Change the target map location point
    }
    //void SteamLeakagePanelClosed(Panel_Base panel)
    //{
    //    //Unsubscribe
    //    observeSteamLeakagePanel.panelDeactivatedEvent -= SteamLeakagePanelClosed;

    //    StartCoroutine(ShowOptions(5));

    //}

    //bool steamLeaking = false;
    //bool noSteamLeaking = false;

    //IEnumerator ShowOptions(float duration)
    //{
    //    yield return new WaitForSeconds(duration);

    //    //Activate the options panel and enable buttons
    //    optionsPanel.ActivatePanel(true);
    //    optionsPanel.EnableButtons();

    //    //Subscribe to appropriate events
    //    optionsPanel.panelDeactivatedEvent += OptionsPanelDeactivated;

    //    optionsPanel.steamLeakingButton.ButtonPressEvent += SteamLeaking;
    //    optionsPanel.noSteamLeakingButton.ButtonPressEvent += NoSteamLeaking;
    //}
    //void SteamLeaking(DOW_Button button)
    //{
    //    steamLeaking = true; optionsPanel.DisableButtons();
    //}
    //void NoSteamLeaking(DOW_Button button)
    //{
    //    noSteamLeaking = true; optionsPanel.DisableButtons();
    //}

    //void OptionsPanelDeactivated(Panel_Base panel)
    //{
    //    optionsPanel.panelDeactivatedEvent -= OptionsPanelDeactivated;

    //    if (steamLeaking)
    //    {
    //        closeBypassPanel.ActivatePanel(true);
    //        closeBypassPanel.panelDeactivatedEvent += BackToOptions;
    //    }
    //    if (noSteamLeaking)
    //    {
    //        NotifyOperatorPanel.ActivatePanel(true);
    //        NotifyOperatorPanel.panelDeactivatedEvent += OperatorNotified;
    //    }

    //    //Reset the leak variables
    //    steamLeaking = false;
    //    noSteamLeaking = false;
    //}


    ////If there's a steam leaking, pressing the next button takes you back to the options
    //void BackToOptions(Panel_Base panel)
    //{
    //    //Unsubscribe
    //    closeBypassPanel.panelDeactivatedEvent -= BackToOptions;
    //    StartCoroutine(ShowOptions(1));
    //}



    void OperatorNotified(Panel_Base panel)
    {
        //Unsubscribe
        NotifyOperatorPanel.panelDeactivatedEvent -= OperatorNotified;

        //Disable the tracker
        VuforiaManager.Instance.DisableTrackerIndex(4);

        SequenceManager.Instance.GoToNextSequence();
        //Once this is done, Force open the tasks panel and show that all the tasks are completed
        PanelManager.Instance.TasksButton.ForceButtonPress();
    }
Example #12
0
    void StepbyStepInstructionPanelClosed(Panel_Base panel)
    {
        PanelManager.Instance.TasksButton.StopBlinking();
        PanelManager.Instance.MapButton.StopBlinking();
        PanelManager.Instance.FilesButton.StopBlinking();

        //Debug.Log("Counter:  " + counter);
        //If all the tabs are pressed and explored, go to next sequence
        //if (counter >= 3)
        //{
        //    Debug.Log("All Tabs Pressed!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
        //    //PanelManager.Instance.arButton.ButtonPressEvent -= StepbyStepInstructionPanelClosed;
        //
        //}

        SequenceManager.Instance.GoToNextSequence();
    }
    void CheckTasksCompletion(Panel_Base panel)
    {
        //submitTasksPanel.ActivatePanel();
        Debug.Log("Tasks completion :   " + tasksCompleted + " count: " + tasksFinished);

        if (tasksCompleted)
        {
            if (!tasksSubmitted)
            {
                submitTasksPanel.ActivatePanel();
                submitTasksPanel.panelDeactivatedEvent += (Panel_Base p) => { tasksSubmitted = true; };
            }
            else
            {
                tasksSubmittedPanel.ActivatePanel();
            }
        }
    }
 public void LinkPanelToButton(DOW_Button button, Panel_Base panel)
 {
     if (button)
     {
         if (!button.GetLinkedPanel())
         {
             button.LinkPanel(panel, this);
             //panelDeactivatedEvent += button.ActivateLinkedPanel;
         }
         else
         {
             Debug.LogWarning("Panel is already linked to this button. Ignoring!");
         }
     }
     else
     {
         Debug.LogError("No button lo link");
     }
 }
 /// <summary>
 /// Link the panel to the button that automatically gets called when the current panel.
 /// Panel activation and deactivation logic is inside the Panel_Base script
 /// </summary>
 /// <param name="panelToLink"></param>
 /// <param name="panelCalledFrom"></param>
 public void LinkPanel(Panel_Base panelToLink, Panel_Base panelCalledFrom)
 {
     panelLinked          = panelToLink;
     this.panelCalledFrom = panelCalledFrom;
 }
Example #16
0
 void TimerPanelActivated(Panel_Base panel)
 {
     timerPanel.StartTimer(10);
 }
Example #17
0
 void TimerPanelDeactivated(Panel_Base panel)
 {
     //Sequence complete
     SequenceManager.Instance.GoToNextSequence();
     //TODO: The next seqeuence might need to be merged into this one
 }
Example #18
0
 public static UtilsPanelChoose.DetailsObjets getDetails(this Panel_Base panel) =>
 panel.TryCast <Panel_ChooseSandbox>()?.m_DetailObjects ?? panel.TryCast <Panel_ChooseChallenge>()?.m_DetailObjects;
Example #19
0
 public static SaveSlotType getSlotType(this Panel_Base panel) =>
 panel.TryCast <Panel_ChooseSandbox>()? SaveSlotType.SANDBOX: SaveSlotType.CHALLENGE;
Example #20
0
 public static void onClickBack(this Panel_Base panel)
 {
     panel.TryCast <Panel_ChooseSandbox>()?.OnClickBack();
     panel.TryCast <Panel_ChooseChallenge>()?.OnClickBack();
 }
Example #21
0
 public static void enable(this Panel_Base panel, bool enabled)
 {
     panel.TryCast <Panel_ChooseSandbox>()?.Enable(enabled);
     panel.TryCast <Panel_ChooseChallenge>()?.Enable(enabled);
 }
 public void UnlinkPanel()
 {
     panelLinked = null;
 }
Example #23
0
 void PanelDeactivated(Panel_Base panel)
 {
     hazardsPanel.panelDeactivatedEvent -= PanelDeactivated;
     SequenceManager.Instance.GoToNextSequence();
 }
Example #24
0
 public static BasicMenu getBasicMenu(this Panel_Base panel) =>
 panel.TryCast <Panel_ChooseSandbox>()?.m_BasicMenu ?? panel.TryCast <Panel_ChooseChallenge>()?.m_BasicMenu;
Example #25
0
 public static SaveSlotInfo getSlotToDelete(this Panel_Base panel) =>
 panel.TryCast <Panel_ChooseSandbox>()?.m_SlotToDelete ?? panel.TryCast <Panel_ChooseChallenge>()?.m_SlotToDelete;
Example #26
0
 public static GameObject getDeleteButton(this Panel_Base panel) =>
 panel.TryCast <Panel_ChooseSandbox>()?.m_MouseButtonDelete ?? panel.TryCast <Panel_ChooseChallenge>()?.m_MouseButtonDelete;