当前位置: 首页>>代码示例>>C#>>正文


C# Tweener类代码示例

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


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

示例7: 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

示例8: 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

示例9: 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

示例10: 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

示例11: 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

示例12: 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

示例13: 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

示例14: 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

示例15: 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


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