Esempio n. 1
0
 public void HUDInteraction()
 {
     StartCoroutine(Tweening.MoveTab(characterRect.gameObject, true, characterRect.position.x, hasHUDLayoutMove ?
                                     bottomLeftPanel.position.x - Mathf.Abs(Utilities.WorldSpaceAnchors(bottomLeftPanel)[0].x) : bottomLeftPanel.position.x, GV.shortAnimationTime));
     StartCoroutine(Tweening.MoveTab(actionRect.gameObject, false, actionRect.position.y, hasHUDLayoutMove ?
                                     bottomRightPanel.position.y - Mathf.Abs(Utilities.WorldSpaceAnchors(bottomRightPanel)[0].y) : bottomRightPanel.position.y, GV.shortAnimationTime));
     /// this condition is only valid when the spell menu is open and the player press escape
     if (canvasGroupSpellAtIndex[0].alpha >= 1 && !hasFXTransitionTerminate)
     {
         StartCoroutine(StairCaseEffect(canvasGroupSpellAtIndex, buttons, buttonsRectParent));
     }
     /// handle the hiding of the inventory when it is active and we press escape
     if (inventoryRect.localScale.x == 1)
     {
         InventoryTabInteraction(inventoryRect.gameObject);
     }
     /// handle the hiding of the message box
     if (InventoryFullDlg.Instance.gameObject.activeSelf || DestroyItemDlg.Instance.gameObject.activeSelf)
     {
         InventoryFullDlg.Instance.gameObject.SetActive(false);
         DestroyItemDlg.Instance.gameObject.SetActive(false);
     }
     StartCoroutine(Tweening.FadeCanvasGroup(canvasGroupMouse, canvasGroupMouse.alpha, hasHUDLayoutMove ? 0 : 1, GV.shortAnimationTime));
     hasHUDLayoutMove = !hasHUDLayoutMove;
 }
Esempio n. 2
0
    public void DisplayUI(bool playerWin)
    {
        panels[playerWin ? 0 : 1].SetActive(true);
        StartCoroutine(Tweening.FadeCanvasGroup(canvasGroup, canvasGroup.alpha, hasFade ? 0 : 1, GV.fadeAnimationTime));
        hasFade = !hasFade;

        StartCoroutine(SceneLoader.Instance.LoadNextScene(playerWin));
    }
    private IEnumerator DisplayTurnText()
    {
        yield return(StartCoroutine(Tweening.FadeCanvasGroup(textDisplayCanvasGroup, textDisplayCanvasGroup.alpha, hasTabFaded ? 1 : 0, GV.fadeAnimationTime)));

        hasTabFaded = !hasTabFaded;
        yield return(new WaitForSeconds(GV.moveAnimationTime));

        yield return(StartCoroutine(Tweening.FadeCanvasGroup(textDisplayCanvasGroup, textDisplayCanvasGroup.alpha, hasTabFaded ? 1 : 0, GV.fadeAnimationTime)));

        hasTabFaded = !hasTabFaded;
    }
Esempio n. 4
0
    private IEnumerator StairCaseEffect(CanvasGroup[] canvasGroup, Button[] buttons, RectTransform buttonsRectParent)
    {
        hasFXTransitionTerminate = true;
        int index = 0;

        while (index < buttons.Length)
        {
            StartCoroutine(Tweening.FadeCanvasGroup(canvasGroup[index], canvasGroup[index].alpha, hasButtonHUDLayoutMove ? 0 : 1, GV.shortAnimationTime));
            StartCoroutine(Tweening.MoveTab(buttons[index].gameObject, true, buttons[index].transform.position.x, hasButtonHUDLayoutMove
                ? buttonsRectParent.position.x - Utilities.WorldSpaceAnchors(buttonsRectParent)[0].x : buttonsRectParent.position.x, GV.shortAnimationTime));
            ++index;
            yield return(new WaitForSeconds(GV.shortAnimationTime));
        }
        hasButtonHUDLayoutMove   = !hasButtonHUDLayoutMove;
        hasFXTransitionTerminate = !hasFXTransitionTerminate;
    }