コード例 #1
0
    /// <summary>
    /// Given data, show overlay
    /// </summary>
    /// <param name="data"></param>
    public void ShowOverlay(OverlayBehavior data)
    {
        overlayBehaviorsToDisplay.Enqueue(data);

        if (currentlyDisplayingOverlay == null)
        {
            currentlyDisplayingOverlay = StartCoroutine(ShowingOverlay());
        }
    }
コード例 #2
0
    /// <summary>
    /// Given data, show overlay.
    /// Only works once per application per overlay data
    /// </summary>
    public void ShowOverlayOncePerApplication(OverlayBehavior data)
    {
        if (PlayerPrefs.HasKey(data.uniqueID))
        {
            return;
        }

        PlayerPrefs.SetInt(data.uniqueID, 1);
        ShowOverlay(data);
    }
コード例 #3
0
 public void Init(OverlayBehavior behavior)
 {
     if (behavior.NumberOfSteps == 0)
     {
         return;
     }
     Data        = behavior;
     currentStep = 0;
     closeOverlayButton.gameObject.SetActive(false);
     UpdateStepButtonStatus();
     UpdateCurrentStep();
     gameObject.SetActive(true);
 }
コード例 #4
0
    /// <summary>
    /// Iterates and displays all queued overlays
    /// </summary>
    private IEnumerator ShowingOverlay()
    {
        while (overlayBehaviorsToDisplay.Count != 0)
        {
            OverlayBehavior data = overlayBehaviorsToDisplay.Dequeue();
            PrimaryInit(data.GetScreenPositionOfOverlay());
            primaryOverlay.Init(data);

            yield return(new WaitUntil(() => closeOverlayFlag));

            closeOverlayFlag = false;
        }
        currentlyDisplayingOverlay = null;
    }