コード例 #1
0
ファイル: TipsManager.cs プロジェクト: msibal6/LabTourV2
    public IEnumerator DisplayTip(int index, float waitTime, bool waiting = false)
    {
        if (waiting)
        {
            while (instance.runningDisplay != null)
            {
                yield return(new WaitForSeconds(0.1f));
            }
        }
        else
        {
            DisablePreviousTip();
        }

        instance.tipsArea = GetComponentInChildren <Canvas>();
        PopUp tip = instance.tips[index];

        //DisablePreviousTips();
        //tip.gameObject.SetActive(true);

        // Showing tip
        tip.transform.parent = instance.tipsArea.transform;
        tip.Display();
        instance.currentPopUp = tip;

        yield return(new WaitForSeconds(waitTime));

        // Closing tip
        tip.Close();
        tip.transform.parent = gameObject.transform;

        instance.currentPopUp   = null;
        instance.runningDisplay = null;
    }
コード例 #2
0
    void OnGUI()
    {
        GUI.skin = skin;
        SceneTransition transition = Singleton.Get <SceneTransition>();

        popUpSettings.Display(ref mTempRect, Time.deltaTime, transition);
        if ((ThrowHead.IsPaused == true) && (transition.State == SceneTransition.Transition.NotTransitioning))
        {
            DisplayPauseMenu(mTempRect, transition);
        }
    }
コード例 #3
0
ファイル: TipsManager.cs プロジェクト: msibal6/LabTourV2
    // HACK FUTURE
    // Display tip group which checks if its a tip group
    public IEnumerator DisplayTips(int start, int end, float betweenTime, bool waiting = false)
    {
        // When we want to display tip after one that is currently shown
        if (waiting)
        {
            while (instance.runningDisplay != null)
            {
                yield return(new WaitForSeconds(0.1f));
            }
        }
        else
        {
            DisablePreviousTip();
        }

        instance.tipsArea = GetComponentInChildren <Canvas>();

        //DisablePreviousTips();

        for (int i = start; i <= end; i++)
        {
            // Calculations for how long to display text
            PopUp tip        = instance.tips[i];
            int   characters = tip.text.text.Length;
            float words      = characters / 5;   // Average number of characters in word
            float waitTime   = words / 300 * 60; // Average reading speed, seconds in minute

            // Activation
            //tip.gameObject.SetActive(true);
            tip.transform.parent  = instance.tipsArea.transform;
            instance.currentPopUp = tip;
            tip.Display();
            yield return(new WaitForSeconds(waitTime));

            // De-activation
            tip.Close();
            tip.transform.parent = gameObject.transform;

            yield return(new WaitForSeconds(betweenTime));
        }

        instance.currentPopUp   = null;
        instance.runningDisplay = null;
    }
コード例 #4
0
    void OnGUI()
    {
        GUI.skin = skin;
        SceneTransition transition = Singleton.Get <SceneTransition>();

        popUpSettings.Display(ref mTempRect, Time.deltaTime, transition);
        switch (MouseOrbitImproved.CurrentState)
        {
        case MouseOrbitImproved.State.Paused:
        case MouseOrbitImproved.State.NotEnoughCharacters:
        case MouseOrbitImproved.State.LostControl:
        case MouseOrbitImproved.State.Finished:
            if (transition.State == SceneTransition.Transition.NotTransitioning)
            {
                DisplayPauseMenu(mTempRect, transition);
            }
            break;
        }
    }
コード例 #5
0
ファイル: GUIStates.cs プロジェクト: czechmate48/TempLog
 public virtual void DisplayPopUp()
 {
     pup.Display();
 }