コード例 #1
0
    public override void StartOpenPopup()
    {
        //Init originPosition of panel.
        if (originPosition == Vector3.back)
        {
            originPosition = this.transform.localPosition;
        }

        //Init
        SetAlphaValue(0);

        //Start move and change alpha value.
        switch (_inDirection)
        {
        case Direction.Left:
            this.transform.localPosition = originPosition + new Vector3(_movingAmount, 0, 0);
            break;

        case Direction.Top:
            this.transform.localPosition = originPosition - new Vector3(0, _movingAmount, 0);
            break;

        case Direction.Right:
            this.transform.localPosition = originPosition - new Vector3(_movingAmount, 0, 0);
            break;

        case Direction.Bottom:
            this.transform.localPosition = originPosition + new Vector3(0, _movingAmount, 0);
            break;
        }

        JTween.MoveTo(this.gameObject, originPosition, _transitionTime, 0, _openTransitionStyle);
        JTween.ValueTo(this.gameObject, 0, 1, _transitionTime, 0, SetAlphaValue, null, _openTransitionStyle);
    }
コード例 #2
0
    public override void StartClosePopup()
    {
        SetAlphaValue(1);

        Vector3 targetPos = Vector3.zero;

        switch (_outDirection)
        {
        case Direction.Left:
            targetPos = originPosition - new Vector3(_movingAmount, 0, 0);
            break;

        case Direction.Top:
            targetPos = originPosition + new Vector3(0, _movingAmount, 0);
            break;

        case Direction.Right:
            targetPos = originPosition + new Vector3(_movingAmount, 0, 0);
            break;

        case Direction.Bottom:
            targetPos = originPosition - new Vector3(0, _movingAmount, 0);
            break;
        }

        JTween.MoveTo(this.gameObject, targetPos, _transitionTime, 0, _openTransitionStyle);
        JTween.ValueTo(this.gameObject, 1, 0, _transitionTime, 0, SetAlphaValue, OnCompleteTransition, _openTransitionStyle);
    }
コード例 #3
0
ファイル: UITabButton.cs プロジェクト: toomarihon/PROJECT_A
    public void Activate(bool flag, bool isForced = false)
    {
        //if cur state is same with next state, didnt do anything.
        //if isForced is true, didnt end this function.
        if (IsActivated == flag && !isForced)
        {
            return;
        }

        IsActivated   = flag;
        _image.sprite = ResourcesManager.Instance.GetSprite(flag ? _spriteOn : _spriteOff);

        //if is forced is true, set size directly.
        if (isForced)
        {
            _rectTransform.sizeDelta = flag ? _sizeOn : _sizeOff;
            return;
        }

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

        if (flag)
        {
            JTween.ValueTo(this.gameObject, sizeDelta.x, _sizeOn.x, GetTransitionTime(), 0, UpdatedWidth, null, _buttonStyle);
            JTween.ValueTo(this.gameObject, sizeDelta.y, _sizeOn.y, GetTransitionTime(), 0, UpdatedHeight, null, _buttonStyle);
        }
        else
        {
            JTween.ValueTo(this.gameObject, sizeDelta.x, _sizeOff.x, GetTransitionTime(), 0, UpdatedWidth, null, _buttonStyle);
            JTween.ValueTo(this.gameObject, sizeDelta.y, _sizeOff.y, GetTransitionTime(), 0, UpdatedHeight, null, _buttonStyle);
        }
    }
コード例 #4
0
ファイル: UITabButton.cs プロジェクト: toomarihon/PROJECT_A
    public override void OnPointerUp(PointerEventData eventData)
    {
        if (IsActivated)
        {
            return;
        }

        JTween.ScaleTo(this.gameObject, _localScale, GetTransitionTime(), 0, _buttonStyle);
    }
コード例 #5
0
    public virtual void OnPointerDown(PointerEventData eventData)
    {
        if (!IsActivated)
        {
            return;
        }

        JTween.ScaleTo(this.gameObject, _localScale * _pressedScale, GetTransitionTime(), 0, _buttonStyle);
    }
コード例 #6
0
ファイル: UITabButton.cs プロジェクト: jinheonok/JNE
    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"));
        }
    }
コード例 #7
0
    public override void OnPointerUp(PointerEventData eventData)
    {
        base.OnPointerUp(eventData);

        JTween.ScaleTo(this.gameObject, _localScale, GetTransitionTime(), 0, _buttonStyle);
    }
コード例 #8
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"));
    }
コード例 #9
0
    public void StartOpenPopup()
    {
        this.transform.localScale = Vector3.zero;

        JTween.ScaleTo(this.gameObject, new Vector3(1, 1, 1), _popupTransitionTime, 0, _curPopupStyle);
    }