Exemplo n.º 1
0
 public bool IsTutorialShown(Tutorial.Part part)
 {
     if (tutorial.ContainsKey(part.name))
     {
         return(Convert.ToInt32(tutorial[part.name]) > 0 ? true : false);
     }
     else
     {
         tutorial[part.name] = 0;
         return(false);
     }
 }
Exemplo n.º 2
0
        public void TutorialShown(Tutorial.Part part)
        {
            if (tutorial.ContainsKey(part.name))
            {
                tutorial[part.name] = Convert.ToInt32(tutorial[part.name]) + 1;
            }
            else
            {
                tutorial[part.name] = 1;
            }

            TutorialSave(true);
        }
Exemplo n.º 3
0
    public void Show(Tutorial.Part part, string param = null)
    {
        this.part = part;

        var textKey = "tutorial" + part.name;

        if (Localization.Exists(textKey + "Premium"))
        {
            textKey = textKey + "Premium";
        }

        if (!string.IsNullOrEmpty(param))
        {
            tipText.text = Localization.Get(textKey, param);
        }
        else if (part.param != null)
        {
            tipText.text = Localization.Get(textKey, part.param());
        }
        else
        {
            tipText.text = Localization.Get(textKey);
        }

        bubble.rectTransform.sizeDelta = new Vector2(bubble.rectTransform.sizeDelta.x, (Mathf.Clamp(tipText.text.Length, l.x, l.y) - l.x) / (l.y - l.x) * (h.y - h.x) + h.x);

        closeButton.gameObject.SetActive(!part.fullscreenClosing);
        fullscreenCloseButton.gameObject.SetActive(part.fullscreenClosing);

        if (part.sprite != null)
        {
            character.sprite = part.sprite;
        }
        else
        {
            character.sprite = isTNT ? pics.characters.vasia : pics.characters.gingerCat;
        }

        if (part.mirror)
        {
            t.localRotation = Quaternion.Euler(0f, 180f, 0f);
            tipText.transform.localRotation               = Quaternion.Euler(0f, 180f, 0f);
            closeButton.transform.localRotation           = Quaternion.Euler(0f, 180f, 0f);
            fullscreenCloseButton.transform.localRotation = Quaternion.Euler(0f, 180f, 0f);
            if (characterShadow != null)
            {
                characterShadow.effectDistance = new Vector2(-10f, -13f);
            }
            if (bubbleShadow != null)
            {
                bubbleShadow.effectDistance = new Vector2(-10f, -13f);
            }

            if (character.sprite == pics.characters.liolia || character.sprite == pics.characters.palna || character.sprite == pics.characters.bobilich || character.sprite == pics.characters.vasia)
            {
                if (character.sprite == pics.characters.bobilich)
                {
                    character.sprite = pics.characters.bobilichMirror;
                }
                else if (character.sprite == pics.characters.vasia)
                {
                    character.sprite = pics.characters.vasiaMirror;
                }
                else if (character.sprite == pics.characters.palna)
                {
                    character.sprite = pics.characters.palnaMirror;
                }
                else if (character.sprite == pics.characters.liolia)
                {
                    character.sprite = pics.characters.lioliaMirror;
                }

                character.transform.localRotation = Quaternion.Euler(0f, 180f, 0f);
            }
        }

        bubble.transform.localScale = Vector3.zero;

        if (part.view == TutorialView.Top)
        {
            t.anchoredPosition = positionUp;
            t.DOAnchorPos(new Vector2(0f, part.offset), 0.5f).SetEase(Ease.OutBack);
            bubble.transform.DOScale(Vector3.one, 0.5f).SetEase(Ease.OutBack).SetDelay(0.2f);
        }
        else if (part.view == TutorialView.Bottom)
        {
            t.anchoredPosition = positionBottom;
            t.DOAnchorPos(new Vector2(0f, part.offset), 0.5f).SetEase(Ease.OutBack);
            bubble.transform.DOScale(Vector3.one, 0.5f).SetEase(Ease.OutBack).SetDelay(0.2f);
        }
        else if (part.view == TutorialView.Left)
        {
            t.anchoredPosition = new Vector2(-1024f * SG_Utils.aspectRatio, part.offset);
            t.DOAnchorPos(new Vector2(0f, t.anchoredPosition.y), 0.6f).SetEase(Ease.OutBack);
            bubble.transform.DOScale(Vector3.one, 0.6f).SetEase(Ease.OutBack).SetDelay(0.25f);
        }
        else if (part.view == TutorialView.Right)
        {
            t.anchoredPosition = new Vector2(1024f * SG_Utils.aspectRatio, part.offset);
            t.DOAnchorPos(new Vector2(0f, t.anchoredPosition.y), 0.6f).SetEase(Ease.OutBack);
            bubble.transform.DOScale(Vector3.one, 0.6f).SetEase(Ease.OutBack).SetDelay(0.25f);
        }
    }