Exemple #1
0
    private void OnPlayerExtend()
    {
        if (_isShowImgExtend)
        {
            TweenManager.GetInstance().RemoveTweenByGo(_imgExtendGo);
        }
        else
        {
            _isShowImgExtend = true;
            _imgExtendGo.SetActive(true);
            _imgExtend.color = new Color(1, 1, 1, 0);
        }
        // 出现
        TweenAlpha tween = TweenManager.GetInstance().Create <TweenAlpha>();

        tween.SetParas(_imgExtendGo, 0, 10, ePlayMode.Once);
        tween.SetParas(1, InterpolationMode.Linear);
        TweenManager.GetInstance().AddTween(tween);
        // 渐隐
        tween = TweenManager.GetInstance().Create <TweenAlpha>();
        tween.SetParas(_imgExtendGo, 120, 20, ePlayMode.Once);
        tween.SetParas(0, InterpolationMode.Linear);
        tween.SetFinishCallBack(OnExtendFinish);
        TweenManager.GetInstance().AddTween(tween);
        SoundManager.GetInstance().Play("se_extend", Consts.DefaultUISEVolume, false, false);
    }
 public void Execute(int cmd, object data)
 {
     if (cmd == CommandConsts.PreloadComplete)
     {
         TweenAlpha tween = TweenManager.GetInstance().Create <TweenAlpha>();
         tween.SetParas(_bgGo, 0, 20, ePlayMode.Once);
         tween.SetParas(1, 0, InterpolationMode.Linear);
         tween.SetFinishCallBack(TweenCallback);
         TweenManager.GetInstance().AddTween(tween);
     }
 }
 public override void Update()
 {
     if (_curFinishCommandCount >= _totalWaitCommandCount)
     {
         UIManager.GetInstance().UnregisterViewUpdate(this);
         // 缓动
         TweenAlpha tween = TweenManager.GetInstance().Create <TweenAlpha>();
         tween.SetParas(_bgGo, 0, 20, ePlayMode.Once);
         tween.SetParas(1, 0, InterpolationMode.Linear);
         tween.SetFinishCallBack(TweenCallback);
         TweenManager.GetInstance().AddTween(tween);
     }
 }