예제 #1
0
 public void StartAttack()
 {
     soldierState = SoldierState.ATTACKING;
     agent.enabled = false;
     swordTween = sword.transform.DOLocalRotate (new Vector3 (0, -83, -20), 0.2f).SetLoops (-1, LoopType.Yoyo);
     StartCoroutine (AttackJump ());
 }
예제 #2
0
    void Start()
    {
        // create a TweenConfig that we will use on all 4 cubes
        var config = new TweenConfig()
            .setEaseType( EaseType.QuadIn ) // set the ease type for the tweens
            .materialColor( Color.magenta ) // tween the material color to magenta
            .eulerAngles( new Vector3( 0, 360, 0 ) ) // do a 360 rotation
            .position( new Vector3( 2, 8, 0 ), true ) // relative position tween so it will be start from the current location
            .setIterations( 2, LoopType.PingPong ); // 2 iterations with a PingPong loop so we go out and back

        // create the chain and set it to have 2 iterations
        var chain = new TweenChain().setIterations( 2 );

        // add a completion handler for the chain
        chain.setOnCompleteHandler( c => Debug.Log( "chain complete" ) );

        // create a Tween for each cube and it to the chain
        foreach( var cube in cubes )
        {
            var tween = new Tween( cube, 0.5f, config );
            chain.append( tween );
        }

        _tween = chain;
    }
예제 #3
0
        void GoToNext()
        {
            //		print (which);
            activateActivators ();
            if(which>2)
                thisSpeed = Vector3.Distance(transform.position,points[which])*speed;
            else
                thisSpeed = Vector3.Distance (astronaut.transform.position, points [which]) * speed;
            if (which == 0) {
                thisSpeed = 0;
                transform.DOMove(points[2], 0).SetEase(Ease.InOutSine);
            }
            if(which>2&&which<points.Length-4)
                go = transform.DOMove(points[which], thisSpeed).SetEase(Ease.InOutSine);
            else if (which == points.Length - 2) {
                astronaut.transform.parent = POD.transform;
                rocketAnim.SetBool("blastOff",true);

                CopyRotation cp = astronautRotator.GetComponent<CopyRotation>();
                cp.bounds = new Vector3(30,0,0);
                cp.minBounds = new Vector3(0,25,0);
                cp.y = true;

                rotateRocket = true;
                Rocket.transform.parent.gameObject.GetComponent<TransformUniversal>().enabled = true;
                go = astronaut.transform.DOMove(points[which], 1).SetEase(Ease.InOutSine);
                Vector3 rot = wayPoints.transform.GetChild(which).transform.localEulerAngles;
                astronaut.transform.DORotate(rot, 1).SetEase(Ease.InOutSine);
            }
            else
                go = astronaut.transform.DOMove(points[which], thisSpeed).SetEase(Ease.InOutSine);

            //		print (thisSpeed);
        }
        public override void Execute()
        {
            var tweener = EntityView.transform.DOMove(Destination, Duration, UseSnapping);
            tweener.Pause();

            CreatedTween = tweener;
        }
예제 #5
0
 public Tween AddTween(IComponent target, Func<float, float> ease, int tweenType, float duration)
 {
     Tween tween = new Tween();
     tween.Setup(target, CreateAccessor(target), ease, tweenType, duration);
     tweens.Add(tween);
     return tween;
 }
예제 #6
0
 public void shake()
 {
     if (shakeTween == null || !shakeTween.IsPlaying())
     {
         shakeTween = transform.DOShakePosition(duration, strength, vibrado, randomness);
     }       
 }
예제 #7
0
    void Start()
    {
        // create a TweenConfig that we will use on all 4 cubes
        var config = new TweenConfig()
            .setEaseType( EaseType.QuadIn ) // set the ease type for the tweens
            .materialColor( Color.magenta ) // tween the material color to magenta
            .eulerAngles( new Vector3( 0, 360, 0 ) ) // do a 360 rotation
            .position( new Vector3( 2, 8, 0 ), true ) // relative position tween so it will be start from the current location
            .setIterations( 2, LoopType.PingPong ); // 2 iterations with a PingPong loop so we go out and back;

        // create the flow and set it to have 2 iterations
        var flow = new TweenFlow().setIterations( 2 );

        // add a completion handler for the chain
        flow.setOnCompleteHandler( c => Debug.Log( "flow complete" ) );

        // create a Tween for each cube and it to the flow
        var startTime = 0f;
        foreach( var cube in cubes )
        {
            var tween = new Tween( cube, 0.5f, config );
            flow.insert( startTime, tween );

            // increment our startTime so that the next tween starts when this one is halfway done
            startTime += 0.25f;
        }

        _tween = flow;
    }
        void Awake()
        {
            tween = GetComponent<Tween>();
            tween.autoPlay = false;

            fsm = new Fsm(this);
        }
예제 #9
0
        internal static Sequence DoInsert(Sequence inSequence, Tween t, float atPosition)
        {
            TweenManager.AddActiveTweenToSequence(t);

            // If t has a delay add it as an interval
            atPosition += t.delay;
            inSequence.lastTweenInsertTime = atPosition;

            t.isSequenced = t.creationLocked = true;
            t.sequenceParent = inSequence;
            if (t.loops == -1) t.loops = 1;
            float tFullTime = t.duration * t.loops;
            t.autoKill = false;
            t.delay = t.elapsedDelay = 0;
            t.delayComplete = true;
            t.isSpeedBased = false;
            t.sequencedPosition = atPosition;
            t.sequencedEndPosition = atPosition + tFullTime;

            if (t.sequencedEndPosition > inSequence.duration) inSequence.duration = t.sequencedEndPosition;
            inSequence._sequencedObjs.Add(t);
            inSequence.sequencedTweens.Add(t);

            return inSequence;
        }
        public override void Execute()
        {
            var tweener = EntityView.transform.DOPunchPosition(PunchVector, Duration, Vibration, Elasticity, UseSnapping);
            tweener.Pause();

            CreatedTween = tweener;
        }
        public override void Execute()
        {
            var tweener = Material.DOColor(NewColour, PropertyName, Duration);
            tweener.Pause();

            CreatedTween = tweener;
        }
예제 #12
0
    private bool RunTween(Tween tween)
    {
        var t = tween.TargetObj.Clock.CurrTime - tween.StartTime;

        if (t < tween.Delay)
            return false;

        if (!tween.Started)
        {
            tween.Started = true;
            tween.__SetStartVal();
            if (tween.StartCallback != null)
                tween.StartCallback(tween.TargetObj);
        }

        if (t >= tween.Duration + tween.Delay)
        {
            tween.Complete = true;
            tween.Property.SetValue(tween.TargetObj, tween.EndVal, null);

            if (tween.EndCallback != null)
                tween.EndCallback(tween.TargetObj);

            if (tween.ChainedTween != null)
            {
                __AddTween(tween.ChainedTween);
            }

            return true;
        }

        var val = tween.EasingType(t - tween.Delay, tween.StartVal, tween.EndVal - tween.StartVal, tween.Duration);
        tween.Property.SetValue(tween.TargetObj, val, null);
        return false;
    }
예제 #13
0
	public void Play() {
		if (_tween != null) {
			_tween.Destroy();
			_tween = null;
		}
		
		_looping = true;
		
		Vector3 theStartPos = _startPosition;	
		Vector3 theEndPos =_startPosition + BounceOffset;
			
		if (_reverse) {
			theStartPos = _startPosition + BounceOffset;
			theEndPos = _startPosition;
		}
		
		//LOOP YOYO:
		_tween = Tween.to(theStartPos, theEndPos, LoopDuration, EaseType, 
			(Tween t) => { transform.localPosition = (Vector3) t.Value;},
			null,
			0f,
			Yoyo,
			LoopCount
		);
		
		if (RandomStartProgress) {
			_tween.SetProgress(Random.Range(0f, 1f));
		}
	}
 public override void Execute()
 {
     var tweener = EntityView.transform.DORotate(DestinationRotation, Duration, RotateMode);
     tweener.Pause();
     
     CreatedTween = tweener;
 }
    public void AddHeart()
    {
        FSprite heart = new FSprite("heart.psd");
        heart.x = Random.Range(heart.width / 2f, Futile.screen.width - heart.width / 2f);
        heart.y = Random.Range(heart.height / 2f, Futile.screen.height - heart.height / 2f - 50f /*UI bar*/);
        heart.scale = 0;
        heart.rotation = Random.Range(0, 359f);
        heart.color = new Color(1.0f, Random.Range(0.0f, 0.3f), Random.Range(0.0f, 0.3f), 1.0f);
        AddChild(heart);
        hearts.Add(heart);

        Go.to(heart, Random.Range(1.0f, 5.0f), new TweenConfig()
            .setIterations(-1)
            .floatProp("rotation", 360 * (RXRandom.Float() < 0.5f ? 1 : -1), true));

        float inflationDuration = Random.Range(1.0f, 2.0f);
        Tween tweenUp = new Tween(heart, inflationDuration, new TweenConfig()
            .floatProp("scale", Random.Range(0.3f, 1.0f))
            .setEaseType(EaseType.SineInOut));

        Tween tweenDown = new Tween(heart, inflationDuration, new TweenConfig()
            .floatProp("scale", 0)
            .onComplete(OnHeartDisappearedWithoutBeingTouched)
            .setEaseType(EaseType.SineInOut));

        TweenChain chain = new TweenChain();
        chain.append(tweenUp);
        chain.append(tweenDown);

        Go.addTween(chain);
        chain.play();
    }
        void Awake()
        {
            tween = GetComponent<Tween>();
            tween.autoPlay = false;

            machine = new StateMachine<GateFSM>(this);
        }
        public override void Execute()
        {
            var tweener = EntityView.transform.DOLookAt(LookAt, Duration, AxisConstraint);
            tweener.Pause();

            CreatedTween = tweener;
        }
예제 #18
0
    public void LevelEnded()
    {
        currentLevel++;

        PauseAllCircles();

        gameManager.gameState = GameState.Transitioning;

        ExecuteDelayedAction(1.0f, () =>
            {
                if (currentLevel == levels.Length)
                {
                    gameManager.gameState = GameState.Ended;

                    TweenFlow fadeOutFlow = new TweenFlow();

                    foreach (GameObject circle in GameObject.FindGameObjectsWithTag("Circle"))
                    {
                        Tween fadeOutTween = new Tween(circle.transform, transitionHalfTime, new TweenConfig().scale(0).setEaseType(EaseType.Linear));
                        fadeOutFlow.insert(0, fadeOutTween);
                    }

                    fadeOutFlow.setOnCompleteHandler((a) =>
                    {
                        ClearLevel();

                        TweenFlow fadeInFlow = new TweenFlow();

                        gameFinishedObject.SetActive(true);
                        Vector3 origScale = gameFinishedObject.transform.localScale;

                        gameFinishedObject.transform.localScale = Vector3.zero;

                        Tween fadeInTween = new Tween(gameFinishedObject.transform, transitionHalfTime, new TweenConfig().scale(origScale).setEaseType(EaseType.QuadIn));

                        fadeInFlow.insert(0, fadeInTween);

                        fadeInFlow.setOnCompleteHandler((aaa) =>
                        {
                            ExecuteDelayedAction(2.0f, () =>
                            {
                                GameObject.Find("PageManager").GetComponent<PageManager>().GoToPage(GamePage.MainMenu);
                            });
                        });

                        fadeInFlow.play();
                    }
                    );

                    gameManager.gameState = GameState.Transitioning;
                    fadeOutFlow.play();
                }
                else
                {
                    SwitchToLevel(currentLevel);
                }
            }
        );
    }
예제 #19
0
 public void SetTween(Color c, Tween.tweenMode tm, float delta)
 {
     this.delta = (tm.Equals(Tween.tweenMode.FADE_IN)) ? -delta : delta;
     initialAlpha = (tm.Equals(Tween.tweenMode.FADE_IN)) ? 1f : 0f;
     this.c = c;
     solid.GetComponent<Image>().color = new Color(c.r, c.g, c.b, initialAlpha);
     active = true;
 }
예제 #20
0
 public void SetTween(Tween t, float delta)
 {
     this.delta = (t.tm.Equals(Tween.tweenMode.FADE_IN)) ? -delta : delta;
     initialAlpha = (t.tm.Equals(Tween.tweenMode.FADE_IN)) ? 1f : 0f;
     c = (t.tc.Equals(Tween.tweenColor.BLACK)) ? Color.black : Color.white;
     solid.GetComponent<Image>().color = new Color(c.r, c.g, c.b, initialAlpha);
     active = true;
 }
예제 #21
0
 private void Pulsate()
 {
     Debug.Log("PULSATE!!! " + (secondsPerBeat * (float)beatScale));
     var scaleUp = new Tween(transform, secondsPerBeat * (float)beatScale, new TweenConfig().scale(defaultScale * scaleTo));
     var scaleDown = new Tween(transform, secondsPerBeat * (float)beatScale, new TweenConfig().scale(defaultScale));
     var scaleChain = new TweenChain().append(scaleUp).append(scaleDown);
     scaleChain.play();
 }
 public override void Execute()
 {
     var rigidbody = EntityView.GetComponent<Rigidbody>();
     var tweener = rigidbody.DORotate(Rotation, Duration, RotateMode);
     tweener.Pause();
     
     CreatedTween = tweener;
 }
        public override void Execute()
        {
            var audioSource = EntityView.GetComponent<AudioSource>();
            var tweener = audioSource.DOFade(Fade, Duration);
            tweener.Pause();

            CreatedTween = tweener;
        }
        public override void Execute()
        {
            var light = EntityView.GetComponent<Light>();
            var tweener = light.DOColor(NewColour, Duration);
            tweener.Pause();

            CreatedTween = tweener;
        }
        public override void Execute()
        {
            var renderer = EntityView.GetComponent<Renderer>();
            var tweener = renderer.material.DOVector(Value, PropertyName, Duration);
            tweener.Pause();

            CreatedTween = tweener;
        }
        public override void Execute()
        {
            var trailRenderer = EntityView.GetComponent<UnityEngine.TrailRenderer>();
            var tweener = trailRenderer.DOResize(StartSize, EndSize, Duration);
            tweener.Pause();

            CreatedTween = tweener;
        }
        public override void Execute()
        {
            var renderer = EntityView.GetComponent<Renderer>();
            var tweener = renderer.material.DOColor(NewColour, Duration);
            tweener.Pause();

            CreatedTween = tweener;
        }
        public override void Execute()
        {
            var rigidbody = EntityView.GetComponent<Rigidbody>();
            var tweener = rigidbody.DOLookAt(LookAt, Duration, AxisConstraint);
            tweener.Pause();

            CreatedTween = tweener;
        }
        public override void Execute()
        {
            var light = EntityView.GetComponent<Light>();
            var tweener = light.DOShadowStrength(ShadowStrength, Duration);
            tweener.Pause();

            CreatedTween = tweener;
        }
예제 #30
0
    /// <summary>
    /// called by a Tween just after this property is validated and added to the Tweens property list
    /// </summary>
    public virtual void init( Tween owner )
    {
        _isInitialized = true;
        _ownerTween = owner;

        // if we dont have an easeFunction use the owners type
        if( _easeFunction == null )
            setEaseType( owner.easeType );
    }
예제 #31
0
 void LoopPauseCube()
 {
     tween = transform.DOLocalMoveX(1f, 2f)
             .SetEase(Ease.Linear)
             .SetLoops(-1, LoopType.Yoyo);
 }
예제 #32
0
        public void Ease_Reverting()
        {
            Entity entity = EntityManager.CreateEntity();

            Tween.Move(EntityManager, entity, TestStartFloat3, TestEndFloat3, TestDuration, default, true);
예제 #33
0
        public Tween Open()
        {
            Tween tween = transform.DOLocalMoveX(-0.7f, 1);

            return(tween);
        }
예제 #34
0
 public TweenInfo(DOTweenAnimation animation, Tween tween, bool isFrom)
 {
     this.animation = animation;
     this.tween     = tween;
     this.isFrom    = isFrom;
 }
예제 #35
0
        public override float GetSpeedBasedDuration(NoOptions options, float unitsXSecond, RectOffset changeValue) => default; // 0x004D13C0-0x004D1490

        public override void EvaluateAndApply(NoOptions options, Tween t, bool isRelative, DOGetter <RectOffset> getter, DOSetter <RectOffset> setter, float elapsed, RectOffset startValue, RectOffset changeValue, float duration, bool usingInversePosition, UpdateNotice updateNotice)
        {
        }                                                                                                                                                                                                                                                                                           // 0x004D1490-0x004D1B60
예제 #36
0
 /// <summary>
 /// Instantiates a tween which changes the <see cref="Light"/>'s range over
 /// time. The Light range is only avaiable on Spot, Point and Area Lights.
 /// </summary>
 /// <param name="self">The target Component.</param>
 /// <param name="to">The target value.</param>
 /// <param name="duration">The Tween's duration.</param>
 /// <returns>A Tween.</returns>
 public static Tween <float> TweenLightRange(this Component self, float to, float duration) =>
 Tween <float> .Add <Driver> (self).Finalize(to, duration);
예제 #37
0
 public TweenDisposable(Tween tween, TweenDisposalBehaviour disposalBehaviour)
 {
     _tween             = tween;
     _disposalBehaviour = disposalBehaviour;
 }
예제 #38
0
 public void UpdateBar(float value, Image img)
 {
     float tweenDuration    = 0.5f;
     float tweenTargetValue = value;
     Tween tween            = DOTween.To(() => img.fillAmount, x => img.fillAmount = x, tweenTargetValue, tweenDuration);
 }
예제 #39
0
    public void PerformMaterialAnimation(float valueToAchieve)
    {
        Tween tween = DOTween.To(() => material.GetFloat(materialProperty), val => { material.SetFloat(materialProperty, val); }, valueToAchieve, timeToAnimate);

        tween.Play();
    }
예제 #40
0
 public bool _shouldAnimateTween <T2>(Tween <T2> tween, T2 targetValue)
 {
     return(!targetValue.Equals(tween.end == null ? tween.begin : tween.end));
 }
예제 #41
0
 public static Tween <float> TweenLocalScaleZ(this GameObject self, float to, float duration) =>
 Tween <float> .Add <Driver> (self).Finalize(to, duration);
        public SoundEffectInstance Emit(string sfx, float volume = 1f, float pitch = 0f, bool insert = true, bool looped = false, bool tween = false)
        {
            if (!Assets.LoadSfx || sfx == null)
            {
                return(null);
            }

            Sfx instance;
            var v = volume * 0.8f;

            if (!insert)
            {
                v *= Audio.MasterVolume * Audio.SfxVolume * Audio.SfxVolumeBuffer;
            }

            var applyBuffer = !sfx.StartsWith("level_explosion");

            /*if (applyBuffer) {
             *      v *= Audio.SfxVolumeBuffer;
             * }*/

            if (!insert || !Playing.TryGetValue(sfx, out instance))
            {
                var sound = Audio.GetSfx(sfx);

                if (sound == null)
                {
                    return(null);
                }

                instance = new Sfx {
                    Effect      = sound.CreateInstance(),
                    KeepAround  = tween,
                    ApplyBuffer = applyBuffer
                };

                if (insert)
                {
                    Playing[sfx] = instance;
                }

                instance.Effect.IsLooped = looped;
            }

            instance.BaseVolume = tween ? 0 : v;

            if (tween)
            {
                var t = Tween.To(v, 0, x => instance.BaseVolume = x, 0.5f);

                t.Delay   = 1f;
                t.OnStart = () => {
                    instance.Effect.Play();
                    instance.KeepAround = false;
                    instance.Effect.Apply3D(Listener, Emitter);
                };
            }

            UpdatePosition();

            instance.Effect.Stop();
            instance.Effect.Pitch = MathUtils.Clamp(-1f, 1f, pitch);

            if (!tween)
            {
                instance.Effect.Play();
            }

            if (Listener != null)
            {
                instance.Effect.Apply3D(Listener, Emitter);
            }

            return(instance.Effect);
        }
예제 #43
0
 void DelayAction(float delay, Action action)
 {
     Tween
     .Delay(delay, action)
     .Start();
 }
예제 #44
0
 public override void _Ready()
 {
     tween = GetNode("Tween") as Tween;
 }
예제 #45
0
 public void MoveToLeft()
 {
     mUIFacade.PlayButtonAudioClip();
     exitTween = mainPanelTween[1];
     mUIFacade.currentScenePanelDict[StringManager.HelpPanel].EnterPanel();
 }
예제 #46
0
 public static void LogNullTween(Tween t)
 {
     LogWarning("Null Tween");
 }
예제 #47
0
 public static Tween <Color> TweenGraphicColor(this GameObject self, Color to, float duration) =>
 Tween <Color> .Add <Driver> (self).Finalize(duration, to);
예제 #48
0
    void Next()
    {
        if (!isPlaying)
        {
            return;
        }
        if (index >= nodes.Length)
        {
            playedCount++;

            // finished
            index = 0;
            if (playCount > 0 && playCount <= playedCount)
            {
                isPlaying = false;
                if (onComplete != null)
                {
                    onComplete();
                }
                return;
            }
        }

        Node      node = nodes[index++];
        Transform t    = node.transform == null ? transform : node.transform;

        tween = null;

        switch (node.action)
        {
        case Action.Activate:
            t.gameObject.SetActive(node.active);
            break;

        case Action.Wait:
            tween = Tween.Delay(node.time + node.delay, null).Target(this);
            break;

        case Action.Run:
            if (t != null)
            {
                TweenPath[] pathes = t.GetComponents <TweenPath>();
                foreach (TweenPath tp in pathes)
                {
                    if (tp.pathName == node.runName)
                    {
                        tp.Play();
                        break;
                    }
                }
            }
            break;

        case Action.Move:
            if (node.time == 0 && node.delay == 0)
            {
                t.localPosition = node.position;
            }
            else
            {
                tween = Tween.Move(t, node.time, node.delay).To(node.position);
                ((Tween.TweenMove)tween).SetSnap(snap);
            }
            break;

        case Action.Rotate:
            if (node.time == 0 && node.delay == 0)
            {
                t.localEulerAngles = node.position;
            }
            else
            {
                tween = Tween.Rotate(t, node.time, node.delay).To(node.position);
            }
            break;

        case Action.Scale:
            if (node.time == 0 && node.delay == 0)
            {
                t.localScale = node.position;
            }
            else
            {
                tween = Tween.Scale(t, node.time, node.delay).To(node.position);
            }
            break;
        }

        if (tween != null)
        {
            tween.Ease(node.easeType);
            if (tweenTag != null)
            {
                tween.Tags(tweenTag);
            }
            if (node.waitForEnd)
            {
                tween.OnComplete(Next);
            }
            tween.Start();
        }
        if (tween == null || !node.waitForEnd)
        {
            Next();
        }
    }
예제 #49
0
 public void Instructive()
 {
     hand.gameObject.SetActive(true);
     t = hand.rectTransform.DOMoveY(handEndPos.position.y, 1.5f).SetLoops(-1, LoopType.Yoyo);
 }
예제 #50
0
 void BounceUp()
 {
     BounceTween             = _objectToBounce.DOScale(new Vector3(1.1f, 1.1f, 1.1f), 0.5f);
     BounceTween.onComplete += BounceDown;
 }
 public static Tween <Vector2> TweenAnchoredPosition(this GameObject self, Vector2 to, float duration) =>
 Tween <Vector2> .Add <Driver> (self).Finalize(duration, to);
예제 #52
0
 void BounceDown()
 {
     BounceTween             = _objectToBounce.DOScale(Vector3.one, 0.5f);
     BounceTween.onComplete += BounceUp;
 }
예제 #53
0
        /// <summary>
        /// Returns TRUE if its actually previewing animations
        /// </summary>
        public static bool PreviewGUI(DOTweenAnimation src)
        {
            if (EditorApplication.isPlaying)
            {
                return(false);
            }

            Styles.Init();

            bool isPreviewing     = _AnimationToTween.Count > 0;
            bool isPreviewingThis = isPreviewing && _AnimationToTween.ContainsKey(src);

            // Preview in editor
            GUI.backgroundColor = isPreviewing
                ? new DeSkinColor(new Color(0.49f, 0.8f, 0.86f), new Color(0.15f, 0.26f, 0.35f))
                : new DeSkinColor(Color.white, new Color(0.13f, 0.13f, 0.13f));
            GUILayout.BeginVertical(Styles.previewBox);
            DeGUI.ResetGUIColors();
            GUILayout.BeginHorizontal();
            GUILayout.Label("Preview Mode - Experimental", Styles.previewLabel);
            _previewOnlyIfSetToAutoPlay = DeGUILayout.ToggleButton(
                _previewOnlyIfSetToAutoPlay,
                new GUIContent("AutoPlay only", "If toggled only previews animations that have AutoPlay turned ON"),
                Styles.btOption
                );
            GUILayout.EndHorizontal();
            GUILayout.Space(1);
            // Preview - Play
            GUILayout.BeginHorizontal();
            EditorGUI.BeginDisabledGroup(
                isPreviewingThis || src.animationType == DOTweenAnimation.AnimationType.None ||
                !src.isActive || _previewOnlyIfSetToAutoPlay && !src.autoPlay
                );
            if (GUILayout.Button("► Play", Styles.btPreview))
            {
                if (!isPreviewing)
                {
                    StartupGlobalPreview();
                }
                AddAnimationToGlobalPreview(src);
            }
            EditorGUI.EndDisabledGroup();
            EditorGUI.BeginDisabledGroup(isPreviewing);
            if (GUILayout.Button("► Play All <i>on GameObject</i>", Styles.btPreview))
            {
                if (!isPreviewing)
                {
                    StartupGlobalPreview();
                }
                DOTweenAnimation[] anims = src.gameObject.GetComponents <DOTweenAnimation>();
                foreach (DOTweenAnimation anim in anims)
                {
                    AddAnimationToGlobalPreview(anim);
                }
            }
            if (GUILayout.Button("► Play All <i>in Scene</i>", Styles.btPreview))
            {
                if (!isPreviewing)
                {
                    StartupGlobalPreview();
                }
                DOTweenAnimation[] anims = Object.FindObjectsOfType <DOTweenAnimation>();
                foreach (DOTweenAnimation anim in anims)
                {
                    AddAnimationToGlobalPreview(anim);
                }
            }
            EditorGUI.EndDisabledGroup();
            GUILayout.EndHorizontal();
            // Preview - Stop
            GUILayout.BeginHorizontal();
            EditorGUI.BeginDisabledGroup(!isPreviewingThis);
            if (GUILayout.Button("■ Stop", Styles.btPreview))
            {
                if (_AnimationToTween.ContainsKey(src))
                {
                    StopPreview(_AnimationToTween[src].tween);
                }
            }
            EditorGUI.EndDisabledGroup();
            EditorGUI.BeginDisabledGroup(!isPreviewing);
            if (GUILayout.Button("■ Stop All <i>on GameObject</i>", Styles.btPreview))
            {
                StopPreview(src.gameObject);
            }
            if (GUILayout.Button("■ Stop All <i>in Scene</i>", Styles.btPreview))
            {
                StopAllPreviews();
            }
            EditorGUI.EndDisabledGroup();
            GUILayout.EndHorizontal();
            if (isPreviewing)
            {
                int playingTweens   = 0;
                int completedTweens = 0;
                int pausedTweens    = 0;
                foreach (KeyValuePair <DOTweenAnimation, TweenInfo> kvp in _AnimationToTween)
                {
                    Tween t = kvp.Value.tween;
                    if (t.IsPlaying())
                    {
                        playingTweens++;
                    }
                    else if (t.IsComplete())
                    {
                        completedTweens++;
                    }
                    else
                    {
                        pausedTweens++;
                    }
                }
                GUILayout.Label("Playing Tweens: " + playingTweens, Styles.previewStatusLabel);
                GUILayout.Label("Completed Tweens: " + completedTweens, Styles.previewStatusLabel);
//                GUILayout.Label("Paused Tweens: " + playingTweens);
            }
            GUILayout.EndVertical();

            return(isPreviewing);
        }
예제 #54
0
        public Tween Close()
        {
            Tween tween = transform.DOLocalMoveX(-0.1677637f, 1);

            return(tween);
        }
예제 #55
0
 protected override void OpenWndEvent()
 {
     base.OpenWndEvent();
     tw = resSvc.LoadTween(DoTweenType.PanelNoraml, imgBgCreateCustomer);
     tw.PlayForward();
 }
예제 #56
0
 private void StartGame()
 {
     collisionState = CollisionState.Enabled;
     //exploder.fragmentInEditor();
     startTween = DOVirtual.DelayedCall(properties.StartDelay, () => { movement.StartMoving(properties.Speed); });
 }
예제 #57
0
 public static void LogNonPathTween(Tween t)
 {
     LogWarning("This Tween is not a path tween");
 }
예제 #58
0
 public static Tween <Color> TweenSpriteRendererColor(this GameObject self, Color to, float duration) =>
 Tween <Color> .Add <Driver> (self).Finalize(duration, to);
예제 #59
0
 protected override Tweener <Color> BuildTweener(Tweener <Color> .Getter getter, Tweener <Color> .Setter setter, Color finalValue, float duration)
 {
     return(Tween.To(getter, setter, finalValue, duration));
 }
 // Token: 0x0600020D RID: 525
 public abstract void EvaluateAndApply(TPlugOptions options, Tween t, bool isRelative, DOGetter <T1> getter, DOSetter <T1> setter, float elapsed, T2 startValue, T2 changeValue, float duration, bool usingInversePosition, UpdateNotice updateNotice);