• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Tweener类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Tweener的典型用法代码示例。如果您正苦于以下问题:C# Tweener类的具体用法?C# Tweener怎么用?C# Tweener使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Tweener类属于命名空间,在下文中一共展示了Tweener类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Vector2Tweener

        public Vector2Tweener( 
			Vector2 start, 
			Vector2 end, 
			TimeSpan duration, 
			TweeningFunction tweeningFunction )
        {
            _tweenerX = new Tweener( start.X, end.X, duration, tweeningFunction ) ;
            _tweenerY = new Tweener( start.Y, end.Y, duration, tweeningFunction) ;

            _tweenerX.Ended += ( ) =>
                               	{
                               		if( _tweenerY.HasEnded )
                               		{
                               			if( Ended != null )
                               			{
                               				Ended( ) ;
                               			}
                               		}
                               	};

            _tweenerY.Ended += ( ) =>
                               	{
                               		if( _tweenerX.HasEnded )
                               		{
                               			if( Ended != null )
                               			{
                               				Ended( ) ;
                               			}
                               		}
                               	};
        }
开发者ID:SteveDunn,项目名称:oglr,代码行数:31,代码来源:Vector2Tweener.cs


示例2: OnEndDrag

 public void OnEndDrag(PointerEventData eventData)
 {
     _isDraging = false;
     if (_transButton.localPosition != Vector3.zero)
     {
         _buttonTweener = _transButton.DOLocalMove(Vector3.zero, 0.3f).SetEase(Ease.OutBack);
     }
 }
开发者ID:AllanUnity,项目名称:Unity_Sample,代码行数:8,代码来源:Joystick.cs


示例3: StopDancing

 public void StopDancing()
 {
     if (_danceTweener != null)
     {
         _danceTweener.Kill();
         ResetRotation();
         _danceTweener = null;
     }
 }
开发者ID:harjup,项目名称:Xyz,代码行数:9,代码来源:PlayerMesh.cs


示例4: Start

 void Start()
 {
     // First create the "move to target" tween and store it as a Tweener.
     // In this case I'm also setting autoKill to FALSE so the tween can go on forever
     // (otherwise it will stop executing if it reaches the target)
     tween = transform.DOMove(target.position, 2).SetAutoKill(false);
     // Store the target's last position, so it can be used to know if it changes
     // (to prevent changing the tween if nothing actually changes)
     targetLastPos = target.position;
 }
开发者ID:NattyBumppo,项目名称:SiloProject,代码行数:10,代码来源:Follow.cs


示例5: LateUpdate

 void LateUpdate()
 {
     if (targetObject != null)
     {
         if (cameraTransform != null)
         {
             lookAtTweener = cameraTransform.DOLookAt(targetObject.center.position, 0.2f);
         }
     }
 }
开发者ID:t1mmmmY,项目名称:SeaDogs,代码行数:10,代码来源:ThirdPersonUserControl.cs


示例6: MovePanel

 void MovePanel(StatPanel obj, string pos, ref Tweener t)
 {
     Panel.Position target = obj.panel [pos];
     if (obj.panel.CurrentPosition != target) {
         if(t != null && t != null)
             t.Stop();
         t = obj.panel.SetPosition(pos, true);
         t.duration = 0.5f;
         t.equation = EasingEquations.EaseOutQuad;
     }
 }
开发者ID:arthurwoo,项目名称:TaticsHero,代码行数:11,代码来源:StatPanelController.cs


示例7: DanceTween

 public void DanceTween()
 {
     if (_danceTweener == null)
     {
         ResetRotation();
         var endVal = _initialRotation.eulerAngles.SetZ(30f);
         _danceTweener = transform.DOLocalRotate(endVal, .5f)
                 .ChangeStartValue(_initialRotation.eulerAngles.SetZ(-30f))
                 .SetLoops(-1, LoopType.Yoyo)
                 .SetEase(Ease.Linear)
                 .Play();
     }
 }
开发者ID:harjup,项目名称:Xyz,代码行数:13,代码来源:PlayerMesh.cs


示例8: StartEffect

 public void StartEffect(string text, float duration)
 {
     _renderState = RenderState.Rendering;
     _sequense = null;
     _sequense = DOTween.Sequence();
     _animation = _textUI.DOText(text, duration);
     _sequense.Append(_animation);
     _sequense.AppendCallback(new TweenCallback(FinishDisplay));
 }
开发者ID:funcodes,项目名称:AirGame,代码行数:9,代码来源:TextEffect.cs


示例9: Awake

 // Use this for initialization
 protected virtual void Awake()
 {
     tweener = SetupTween();
     tweener.SetEase(easeType);
     tweener.SetAutoKill(false);
     tweener.Pause();
 }
开发者ID:steveimc,项目名称:Rawr,代码行数:8,代码来源:UITween.cs


示例10: FadeIn

 //fade clip up to its PlayVolume over the given time
 public void FadeIn(float time, Holoville.HOTween.EaseType ease = EaseType.Linear)
 {
     if (_curLoop != null)
       {
      _curClipFadeIn = HOTween.To(_curLoop.GetComponent<AudioSource>(), time, new TweenParms().Prop("volume", PlayVolume).Ease(ease));
       }
 }
开发者ID:mmandel,项目名称:8Nights2,代码行数:8,代码来源:SpawnAudioLoop.cs


示例11: Setup

        // ===================================================================================
        // PUBLIC METHODS --------------------------------------------------------------------

        public static void Setup(IHOtk2dSlicedSprite pEvidenceSprite, bool pTweenEvidence = true, float pEvidenceBorder = 0, bool pLoop = false, bool pRolloverEffects = true)
        {
            _evidenceSprite = pEvidenceSprite;
            evidenceBorder = pEvidenceBorder;
            loop = pLoop;
            rolloverEffects = pRolloverEffects;

            if (_evidenceTween != null) {
                _evidenceTween.Rewind();
                _evidenceTween.Kill();
                _evidenceTween = null;
            }
            if (_evidenceSprite != null) {
                _evidenceSprite.gameObject.SetActive(false);
                Color toCol = _evidenceSprite.color;
                toCol.a *= 0.5f;
                if (pTweenEvidence) {
                    _evidenceTween = DOTween.To(() => _evidenceSprite.color, x => _evidenceSprite.color = x, toCol, 0.4f)
                        .SetLoops(-1, LoopType.Yoyo)
                        .SetEase(Ease.InOutQuad)
                        .OnKill(() => _evidenceTween = null)
                        .Pause();
                }
            }
        }
开发者ID:fergu00,项目名称:hounitylibs,代码行数:28,代码来源:HOMenuControlSystem.cs


示例12: AddPlayer

    public void AddPlayer(int playerIndex){
        playerIndexes[playerIndex] = 1;

        if (_waveTweenr != null) _waveTweenr.Kill();
        _InitialWave = 0;
        _waveTweenr =  HOTween.To(this, 0.2f, new TweenParms().Prop("_InitialWave", 1).Loops(2, LoopType.Yoyo));
    }
开发者ID:noamgat,项目名称:ggj2016,代码行数:7,代码来源:Segment.cs


示例13: Apply

        public override void Apply()
        {
            GearLookValue gv;
            if (!_storage.TryGetValue(_controller.selectedPageId, out gv))
                gv = _default;

            if (tween && UIPackage._constructing == 0 && !disableAllTweenEffect)
            {
                _owner._gearLocked = true;
                _owner.grayed = gv.grayed;
                _owner._gearLocked = false;

                if (tweener != null)
                {
                    if (_tweenTarget.alpha != gv.alpha || _tweenTarget.rotation != gv.rotation)
                    {
                        tweener.Kill(true);
                        tweener = null;
                    }
                    else
                        return;
                }

                bool a = gv.alpha != _owner.alpha;
                bool b = gv.rotation != _owner.rotation;
                if (a || b)
                {
                    _owner.internalVisible++;
                    _tweenTarget = gv;

                    tweener = DOTween.To(() => new Vector2(_owner.alpha, _owner.rotation), val =>
                    {
                        _owner._gearLocked = true;
                        if (a)
                            _owner.alpha = val.x;
                        if (b)
                            _owner.rotation = val.y;
                        _owner._gearLocked = false;
                    }, new Vector2(gv.alpha, gv.rotation), tweenTime)
                    .SetEase(easeType)
                    .SetUpdate(true)
                    .OnComplete(() =>
                    {
                        tweener = null;
                        _owner.internalVisible--;
                    });

                    if (delay > 0)
                        tweener.SetDelay(delay);
                }
            }
            else
            {
                _owner._gearLocked = true;
                _owner.alpha = gv.alpha;
                _owner.rotation = gv.rotation;
                _owner.grayed = gv.grayed;
                _owner._gearLocked = false;
            }
        }
开发者ID:kensong1194717296,项目名称:FairyGUI-unity,代码行数:60,代码来源:GearLook.cs


示例14: OnClick

	void OnClick(){
		if( Time.timeSinceLevelLoad> 0.1f ){
			if( State == 0 ){
				SettingsTween = HOTween.To(Menü, 0.5f, new TweenParms().AutoKill(false)
				                           .Prop("position",MenüPos, true) // Position tween (set as relative)
				                           .Ease(EaseType.EaseInOutQuad) // Ease
				                           );
				SettingsTween.Pause ();
				TweenSlider.ShowMenue = name;
				SettingsTween.PlayForward ();
				OldIcon = Icon.GetComponent<UISprite>().spriteName;
				Icon.GetComponent<UISprite>().spriteName = "ArrowBack";
				Icon.GetComponent<UIButton>().normalSprite = "ArrowBack";
				Icon.transform.localScale = Icon.transform.localScale/1.2f;
				transform.Rotate(0,0,-90);
				Menü.GetComponent<AudioSource>().Play();
				State = 1;
			}else if (State == 1){
				TweenSlider.ShowMenue = null;
				SettingsTween.PlayBackwards ();
				Icon.GetComponent<UISprite>().spriteName = OldIcon;
				Icon.GetComponent<UIButton>().normalSprite = OldIcon;
				Icon.transform.localScale = Icon.transform.localScale*1.2f;
				transform.Rotate(0,0,90);
				Menü.GetComponent<AudioSource>().Play();
				State = 0;
			}
		}
	}
开发者ID:Keyj1n,项目名称:BattlePong,代码行数:29,代码来源:TweenSettings.cs


示例15: doPath

 void doPath()
 {
     currentTween = HOTween.To (mCamera, mVisitGuidedTime, new TweenParms ()
                                     .Prop ("position", new PlugVector3Path (convertTransformArrayToVector3 (path), PathType.Curved)
                                     .OrientToPath (0.075f))
                                     .Ease (EaseType.Linear)
                                     .OnComplete (onSequenceCompleted));
 }
开发者ID:thomaschampagne,项目名称:3dvisitmockup,代码行数:8,代码来源:GuidedVisitManager.cs


示例16: AnimateCorrect

 public void AnimateCorrect()
 {
     correct = true;
     //do animation
     if (colorTween != null)
         colorTween.Kill(true);
     colorTween = DOTween.To(() => letter.color, x => letter.color = x, Color.red, 0.25f);
 }
开发者ID:gww2,项目名称:EvilTiles,代码行数:8,代码来源:Tile.cs


示例17: Activate

 public virtual void Activate()
 {
     RevealKeyCombination(0);
     float maxDist = PlatformSpawner.Instance.MaxDistanceY * 2;
     _moveTween = transform.DOMoveY(transform.position.y + maxDist, DurationCoeff * maxDist)
         .SetEase(Ease.InOutCubic)
         .SetLoops(-1, LoopType.Yoyo);
     PlatformSpawner.Instance.RemoveCandidatePlatform(this);
 }
开发者ID:maynull,项目名称:LeftRightXoX,代码行数:9,代码来源:Platform.cs


示例18: SetPanelPos

    void SetPanelPos(string pos)
    {
        if (transition != null && transition.IsPlaying)
            transition.Stop ();

        transition = panel.SetPosition (pos, true);
        transition.duration = 0.5f;
        transition.equation = EasingEquations.EaseInOutQuad;
    }
开发者ID:arthurwoo,项目名称:TaticsHero,代码行数:9,代码来源:HitSuccessIndicator.cs


示例19: Apply

        public override void Apply()
        {
            GearSizeValue gv;
            if (!_storage.TryGetValue(_controller.selectedPageId, out gv))
                gv = _default;

            if (tween && UIPackage._constructing == 0 && !disableAllTweenEffect)
            {
                if (tweener != null)
                {
                    if (_tweenTarget.width != gv.width || _tweenTarget.height != gv.height
                        || _tweenTarget.scaleX != gv.scaleX || _tweenTarget.scaleY != gv.scaleY)
                    {
                        tweener.Kill(true);
                        tweener = null;
                    }
                    else
                        return;
                }

                bool a = gv.width != _owner.width || gv.height != _owner.height;
                bool b = gv.scaleX != _owner.scaleX || gv.scaleY != _owner.scaleY;
                if (a || b)
                {
                    _owner.internalVisible++;
                    _tweenTarget = gv;

                    tweener = DOTween.To(() => new Vector4(_owner.width, _owner.height, _owner.scaleX, _owner.scaleY), v =>
                    {
                        _owner._gearLocked = true;
                        if (a)
                            _owner.SetSize(v.x, v.y, _owner.gearXY.controller == _controller);
                        if (b)
                            _owner.SetScale(v.z, v.w);
                        _owner._gearLocked = false;
                    }, new Vector4(gv.width, gv.height, gv.scaleX, gv.scaleY), tweenTime)
                    .SetEase(easeType)
                    .SetUpdate(true)
                    .OnComplete(() =>
                    {
                        tweener = null;
                        _owner.internalVisible--;
                        _owner.InvalidateBatchingState();
                    });

                    if (delay > 0)
                        tweener.SetDelay(delay);
                }
            }
            else
            {
                _owner._gearLocked = true;
                _owner.SetSize(gv.width, gv.height, _owner.gearXY.controller == _controller);
                _owner.SetScale(gv.scaleX, gv.scaleY);
                _owner._gearLocked = false;
            }
        }
开发者ID:kensong1194717296,项目名称:FairyGUI-unity,代码行数:57,代码来源:GearSize.cs


示例20: TweenPlayBackward

    public void TweenPlayBackward()
    {
        if (_rect == null && _rect.anchoredPosition==UIPosForm)
            return;

        //form

        //to
        tweener_move = _rect.DOAnchorPos(UIPosForm, delayTime, true);
    }
开发者ID:sparxepisode,项目名称:Dark-Flame,代码行数:10,代码来源:UITweenPos.cs



注:本文中的Tweener类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Tweet类代码示例发布时间:2022-05-24
下一篇:
C# TweenAction类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap