public void SwitchToSection(GameObject section)
    {
        if (AnimationAssistant.IsShown(section.GetComponent <CanvasGroup>()))
        {
            return;
        }

        _deactivateCurrentSection();

        AnimationAssistant.SwitchFromTo(_activeSection.GetComponent <CanvasGroup>(),
                                        section.GetComponent <CanvasGroup>());

        _activeSection = section;

        switch (section.name)
        {
        case "ProgrammeView":
            _changeCaseToActive(_programmeCase);
            break;

        case "NewsView":
            _changeCaseToActive(_newsCase);
            break;

        case "NavigationView":
            _changeCaseToActive(_navigationCase);
            _gradient.alpha = 0f;
            break;
        }
    }
 private void _show(string address)
 {
     if (!address.Equals(""))
     {
         AnimationAssistant.Show(_canvasGroup);
     }
 }
Exemplo n.º 3
0
    private IEnumerator _sendLoginData(string email)
    {
        var wwwForm = new WWWForm();

        wwwForm.AddField("email", email);

        var www = new WWW(InfoStorage.Server + InfoStorage.Connect, wwwForm);

        yield return(www);

        Debug.Log(InfoStorage.Server + InfoStorage.Connect);

        if (www.error != null)
        {
            yield break;
        }

        Debug.Log(www.text);

        var json = JSON.Parse(www.text);

        string answer = json["error"];

        Debug.Log(answer);

        if (!answer.Equals("ok"))
        {
            yield break;
        }

        PlayerPrefs.SetString("email", email);
        PlayerPrefs.SetInt("auntificated", 1);

        AnimationAssistant.MoveY(transform, transform.position.y - Screen.height);
    }
Exemplo n.º 4
0
    public void SwitchToCase(Transform _dateList)
    {
        if (AnimationAssistant.IsShown(_dateList.GetComponent <CanvasGroup>()))
        {
            return;
        }

        _deactivateCurrentCase();

        AnimationAssistant.SwitchFromTo(_activeDateList.GetComponent <CanvasGroup>(), _dateList.GetComponent <CanvasGroup>());

        _activeDateList = _dateList;

        _mainScrollRect.content = _dateList as RectTransform;
        _updateIndicator.SetList(_dateList);

        switch (_dateList.name)
        {
        case "Programme12Date":
            _changeCaseToActive(_date12);
            break;

        case "Programme13Date":
            _changeCaseToActive(_date13);
            break;

        case "Programme14Date":
            _changeCaseToActive(_date14);
            break;

        case "Programme15Date":
            _changeCaseToActive(_date15);
            break;
        }
    }
Exemplo n.º 5
0
 private IEnumerator _animateIndicatorCoroutine()
 {
     while (_rotate)
     {
         AnimationAssistant.LocalRotateZ180(_indicator);
         yield return(new WaitForSeconds(AnimationAssistant.AnimationSpeedDefault));
     }
 }
Exemplo n.º 6
0
 public void Open()
 {
     if (_opened)
     {
         return;
     }
     _opened = true;
     AnimationAssistant.MoveX(transform, _xOpened);
 }
Exemplo n.º 7
0
 public void Close()
 {
     if (!_opened)
     {
         return;
     }
     _opened = false;
     AnimationAssistant.MoveX(transform, _xClosed);
 }
Exemplo n.º 8
0
    public void Close()
    {
        if (!_opened)
        {
            return;
        }

        _helper.PanelClose();
        _opened = false;
        AnimationAssistant.MoveY(transform, InfoStorage.ClosedPanelPosY);
    }
Exemplo n.º 9
0
    public void Open()
    {
        if (_opened)
        {
            return;
        }

        _helper.Increase();

        _opened = true;
        AnimationAssistant.MoveY(transform, InfoStorage.OpenedPanelPosY);
    }
Exemplo n.º 10
0
    private IEnumerator _loginFormUpCoroutine()
    {
        yield return(new WaitForSeconds(0.5f));

        AnimationAssistant.Hide(gameObject.GetComponent <CanvasGroup>());

        if (PlayerPrefs.GetInt("auntificated") != 1)
        {
            AnimationAssistant.MoveLocalY(_loginForm, 0);
        }
        else
        {
            AnimationAssistant.MoveY(_loginPanel, InfoStorage.ClosedPanelPosY);
        }
    }
Exemplo n.º 11
0
    public void Escape()
    {
        if (_lock)
        {
            return;
        }

        switch (_context)
        {
        case Context.Feedback:
            AnimationAssistant.MoveY(_feedback, _feedback.transform.position.y - PlayerPrefs.GetFloat("height"));
            _context = Context.Main;
            break;

        case Context.Instagram:
            AnimationAssistant.MoveY(_instagram, _instagram.transform.position.y - PlayerPrefs.GetFloat("height"));
            _context = Context.Main;
            break;
        }
    }
Exemplo n.º 12
0
    public void SendScore(int value)
    {
        for (var i = 0; i < transform.childCount; i++)
        {
            transform.GetChild(i).GetComponent <Image>().sprite = _inactiveStar;
        }

        for (var i = 0; i < value; i++)
        {
            transform.GetChild(i).GetComponent <Image>().sprite = _activeStar;
        }

        var score = new Score(value, InfoStorage.DateTimeToUnixTimeStamp(DateTime.Now.Date));

        var dtnow = DateTime.Now;

        PlayerPrefs.SetInt(dtnow.Year + "." + dtnow.Month + "." + dtnow.Day, value);
        AnimationAssistant.Hide(_cg);

        StartCoroutine(_sendScoreCoroutine(score));
    }
    private IEnumerator _sendQuestionCoroutine(string text)
    {
        var wwwForm = new WWWForm();

        wwwForm.AddField("text", text);
        wwwForm.AddField("email", PlayerPrefs.GetString("email"));

        var www = new WWW(InfoStorage.Server + InfoStorage.QuestionApi, wwwForm);

        yield return(www);

        if (www.error == null)
        {
            AnimationAssistant.QuestionAnimation(_form, _success);
        }
        else
        {
            _questions.Enqueue(text);
            EventStorage.Instance.ConnectionEstablished.AddListener(_sendAllCachedQuestions);
            AnimationAssistant.QuestionAnimation(_form, _failure);
        }
    }
Exemplo n.º 14
0
    public void DecreaseZoomAndUpdate()
    {
        if (_updateLock)
        {
            return;
        }

        _updateLock = true;

        if (_zoom == MinZoom + 1)
        {
            AnimationAssistant.Hide(_minus);
        }

        if (!AnimationAssistant.IsShown(_plus))
        {
            AnimationAssistant.Show(_plus);
        }

        _zoom--;
        _refreshMap();
    }
 public void OnPointerClick(PointerEventData eventData)
 {
     AnimationAssistant.ButtonEffect(transform);
     _es.OpenMaps.Invoke();
 }
Exemplo n.º 16
0
    private void _expand()
    {
        _expanded = true;

        AnimationAssistant.ExpandAndFade(_rt, new Vector2(_rt.sizeDelta.x, _vlg.preferredHeight), _cg, 1f, true);
    }
Exemplo n.º 17
0
    private void _narrow()
    {
        _expanded = false;

        AnimationAssistant.ExpandAndFade(_rt, new Vector2(_rt.sizeDelta.x, 0), _cg, 0f, false);
    }
Exemplo n.º 18
0
 public void OnPointerClick(PointerEventData eventData)
 {
     _eventStorage.MapToDefault.Invoke();
     AnimationAssistant.LocalRotateZ180(transform);
 }
Exemplo n.º 19
0
 private void _narrowText()
 {
     AnimationAssistant.ExpandRect(_rt, new Vector2(_rt.sizeDelta.x, InfoStorage.MaxDefaultTextSize));
     _expanded = false;
 }
Exemplo n.º 20
0
 private void _expandText()
 {
     AnimationAssistant.ExpandRect(_rt, new Vector2(_rt.sizeDelta.x, _text.preferredHeight));
     _expanded = true;
 }
Exemplo n.º 21
0
 void Awake()
 {
     main = this;
 }
Exemplo n.º 22
0
 protected void _changeCaseToActive(Transform caseObj)
 {
     AnimationAssistant.ChangeTextColor(caseObj.FindChild("Text").GetComponent <Text>(), ActiveTextColor);
     AnimationAssistant.ImageColor(caseObj.GetComponent <Image>(), ActiveColor);
 }
 public void OnPointerClick(PointerEventData eventData)
 {
     _eventStorage.MapToUser.Invoke();
     AnimationAssistant.ButtonEffect(transform);
 }
 private void _hide()
 {
     AnimationAssistant.Hide(_canvasGroup);
 }
 private void _show()
 {
     AnimationAssistant.Show(_canvasGroup);
 }
    public void Notify(string notification)
    {
        _text.text = notification;

        AnimationAssistant.FadeText(_text, 1);
    }
 public void StopCurrent()
 {
     _text.text = "";
     AnimationAssistant.FadeText(_text, 0);
 }
Exemplo n.º 28
0
 void  Awake()
 {
     main = this;
 }
 private void _initializeFirst()
 {
     _changeCaseToActive(_programmeCase);
     AnimationAssistant.Show(_activeSection.GetComponent <CanvasGroup>());
 }