コード例 #1
0
 public void SetUIData(byte index)
 {
     gameObject.SetActive(true);
     _icon.sprite = UISpriteRepository.i.GetGameSprite(_emoticonTextureNames[index]);
     //_tween.from = new Vector3(0,0,0);
     //_tween.to = new Vector3(1, 1, 1);
     _tween.ResetToBeginning();
     _tween.onFinished.RemoveAllListeners();
     _tween.onFinished.AddListener(() => _loop = true);
     _tween.PlayForward();
     _accTime = 0;
 }
コード例 #2
0
ファイル: HUDCardContent.cs プロジェクト: Pacman18/ProudTest
        public void SetUIData(CARD_STAT stat)
        {
            if (_currentStat == stat)
            {
                return;
            }

            _currentStat = stat;


            transform.localScale = Vector3.one;

            _disableImage.enabled = false;

            switch (_currentStat)
            {
            case CARD_STAT.SHOW:     // 카드가 등장하는부분
                _tweenPos.from     = RectTrans.anchoredPosition;
                _tweenPos.to       = _normalPos;
                _tweenPos.duration = 0.5f;
                _tweenPos.method   = EaseType.easeOutExpo;
                _tweenPos.ResetToBeginning();
                _tweenPos.PlayForward();
                break;

            case CARD_STAT.ENABLE:     // 사용할 수 있는 디폴트
                _tweenPos.from     = RectTrans.anchoredPosition;
                _tweenPos.to       = _normalPos;
                _tweenPos.duration = 0.1f;
                _tweenPos.method   = EaseType.linear;
                _tweenPos.ResetToBeginning();
                _tweenPos.PlayForward();
                break;

            case CARD_STAT.DISABLE:     // 사용 못하는 부분
                _disableImage.enabled = true;
                _tweenPos.from        = RectTrans.anchoredPosition;
                _tweenPos.to          = _normalPos;
                _tweenPos.duration    = 0.1f;
                _tweenPos.method      = EaseType.linear;
                _tweenPos.ResetToBeginning();
                _tweenPos.PlayForward();
                break;

            case CARD_STAT.SELECT:
                _tweenPos.from     = _normalPos;
                _tweenPos.to       = _selectPos;
                _tweenPos.duration = 0.1f;
                _tweenPos.method   = EaseType.linear;
                _tweenPos.ResetToBeginning();
                _tweenPos.PlayForward();
                break;

            case CARD_STAT.SUMMON:
                _tweenScale.from     = Vector3.one;
                _tweenScale.to       = _summonScale;
                _tweenScale.duration = 0.3f;
                _tweenScale.method   = EaseType.linear;
                _tweenPos.ResetToBeginning();
                _tweenScale.PlayForward();
                break;

            case CARD_STAT.HIDDEN:
                _tweenPos.from     = RectTrans.anchoredPosition;
                _tweenPos.to       = _hiddenPos;
                _tweenPos.duration = 0.2f;
                _tweenPos.method   = EaseType.linear;
                _tweenPos.ResetToBeginning();
                _tweenPos.PlayForward();
                break;
            }
        }