private void PlayCGAni(object[] datas)
    {
        _charCGGo.SetActive(true);
        _isPlayingCharCG = true;
        string path = (string)datas[0];

        _charCGImg.sprite = Resources.Load <Sprite>(path);
        _charCGImg.SetNativeSize();
        ILuaState        luaState  = (ILuaState)datas[1];
        List <TweenBase> tweenList = ParseLuaTableToTweenList(luaState);
        int       count            = tweenList.Count;
        int       maxTime          = 0;
        TweenBase tween;

        for (int i = 0; i < count; i++)
        {
            tween = tweenList[i];
            if (maxTime < tween.delay + tween.duration)
            {
                maxTime = tween.delay + tween.duration;
            }
        }
        TweenPos2D endTween = new TweenPos2D();

        endTween.SetParas(_charCGGo, maxTime + 1, 0, ePlayMode.Once);
        endTween.SetFinishCallBack(OnPlayCGFinish);
        endTween.SetIgnoreTimeScale(false);
        TweenManager.GetInstance().AddTweens(_charCGGo, tweenList);
    }
Esempio n. 2
0
    /// <summary>
    /// 显示符卡名称
    /// </summary>
    private void ShowSpellCardInfo(string scName)
    {
        _scNameText.text = scName;
        _scNameObject.SetActive(true);
        _scNameObject.transform.localPosition = new Vector2(192, -112);
        TweenPos2D tweenPos = TweenManager.GetInstance().Create <TweenPos2D>();

        tweenPos.SetParas(_scNameObject, 60, 60, ePlayMode.Once);
        tweenPos.SetParas(new Vector2(192, -112), new Vector2(192, 224), InterpolationMode.Linear);
        tweenPos.SetIgnoreTimeScale(false);
        TweenManager.GetInstance().AddTween(tweenPos);
        _isShowSpellCardInfo = true;
    }