Esempio n. 1
0
    public void Activate(bool flag)
    {
        interactable = flag;

        Vector2 sizeDelta = this.GetComponent <RectTransform> ().sizeDelta;

        if (flag)
        {
            _image.sprite = SpriteResources.Instance.GetSprite(_spriteOn);
            JTween.ValueTo(this.gameObject, JTween.Hash("from", sizeDelta.x, "to", _sizeOn.x, "time", GetTransitionTime(), "easeType", _buttonStyle, "onupdate", "UpdatedWidth"));
            JTween.ValueTo(this.gameObject, JTween.Hash("from", sizeDelta.y, "to", _sizeOn.y, "time", GetTransitionTime(), "easeType", _buttonStyle, "onupdate", "UpdatedHeight"));
        }
        else
        {
            _image.sprite = SpriteResources.Instance.GetSprite(_spriteOff);
            JTween.ValueTo(this.gameObject, JTween.Hash("from", sizeDelta.x, "to", _sizeOff.x, "time", GetTransitionTime(), "easeType", _buttonStyle, "onupdate", "UpdatedWidth"));
            JTween.ValueTo(this.gameObject, JTween.Hash("from", sizeDelta.y, "to", _sizeOff.y, "time", GetTransitionTime(), "easeType", _buttonStyle, "onupdate", "UpdatedHeight"));
        }
    }
Esempio n. 2
0
    public void StartClosePopup()
    {
        this.transform.localScale = this.transform.localScale;

        JTween.ScaleTo(this.gameObject, JTween.Hash("scale", Vector3.zero, "time", _popupTransitionTime, "easetype", _curPopupStyle, "oncomplete", "ClosePopup"));
    }