Пример #1
0
        /// <summary>
        /// Creates a new Sequence.
        /// </summary>
        /// <param name="p_parms">
        /// A <see cref="SequenceParms"/> representing the Sequence parameters.
        /// You can pass an existing one, or create a new one inline via method chaining,
        /// like <c>new SequenceParms().Id("sequence1").Loops(2).OnComplete(myFunction)</c>
        /// </param>
        public Sequence(SequenceParms p_parms)
        {
            if (p_parms != null) p_parms.InitializeSequence(this);

            // Automatically pause the sequence.
            _isPaused = true;

            // Add this sequence to HOTWeen tweens.
            HOTween.AddSequence(this);
        }
Пример #2
0
        /// <summary>
        /// Creates a new Sequence.
        /// </summary>
        /// <param name="p_parms">
        /// A <see cref="SequenceParms"/> representing the Sequence parameters.
        /// You can pass an existing one, or create a new one inline via method chaining,
        /// like <c>new SequenceParms().Id("sequence1").Loops(2).OnComplete(myFunction)</c>
        /// </param>
        public Sequence(SequenceParms p_parms)
        {
            if (p_parms != null)
            {
                p_parms.InitializeSequence(this);
            }

            // Automatically pause the sequence.
            _isPaused = true;

            // Add this sequence to HOTWeen tweens.
            HOTween.AddSequence(this);
        }
Пример #3
0
 /// <summary>
 /// Clears this sequence and resets its parameters, so it can be re-used.
 /// You can check if a Sequence is clean by querying its isEmpty property.
 /// </summary>
 /// <param name="p_parms">
 /// New parameters for the Sequence
 /// (if NULL, note that the dafult ones will be used, and not the previous ones)
 /// </param>
 public void Clear(SequenceParms p_parms = null)
 {
     Kill(false);
     Reset();
     hasCallbacks = false;
     prevIncrementalCompletedLoops = prevIncrementalCompletedLoops = 0;
     _destroyed = false;
     // Apply new parms
     if (p_parms != null)
     {
         p_parms.InitializeSequence(this);
     }
     _isPaused = true;
 }
Пример #4
0
    void JumpMotion()
    {
        animator.SetTrigger("Jump");

        SequenceParms sparams = new SequenceParms(); //.OnComplete(gameObject, "OnCompleteJump");
        Sequence mySequence = new Sequence(sparams);
        TweenParms parms;

        tf.position = startPosition;

        parms = new TweenParms().Prop("position", startPosition).Ease(EaseType.EaseOutQuad).OnComplete(OnDoneTakeOff);
        mySequence.Append(HOTween.To(tf, 0.4f, parms));

        parms = new TweenParms().Prop("position", endPosition).Ease(EaseType.EaseOutQuad).OnComplete(OnDoneAir);
        mySequence.Append(HOTween.To(tf, 0.2f, parms));

        parms = new TweenParms().Prop("position", endPosition).Ease(EaseType.EaseOutQuad).OnComplete(OnDoneLanding);
        mySequence.Append(HOTween.To(tf, 0.6f, parms));

        mySequence.Play();
    }
Пример #5
0
 /// <summary>
 /// Clears this sequence and resets its parameters, so it can be re-used.
 /// You can check if a Sequence is clean by querying its isEmpty property.
 /// </summary>
 /// <param name="p_parms">
 /// New parameters for the Sequence
 /// (if NULL, note that the dafult ones will be used, and not the previous ones)
 /// </param>
 public void Clear(SequenceParms p_parms = null)
 {
     Kill(false);
     Reset();
     hasCallbacks = false;
     prevIncrementalCompletedLoops = prevIncrementalCompletedLoops = 0;
     _destroyed = false;
     // Apply new parms
     if (p_parms != null) p_parms.InitializeSequence(this);
     _isPaused = true;
 }
Пример #6
0
 void TweenMove2Back(Transform tr, Vector3 pos1, Vector3 pos2, Vector3 pos3)
 {
     tr.localPosition = pos1;
     SequenceParms sparams = new SequenceParms(); //.OnComplete(tr, "OnCompleteTween", 1);
     Sequence mySequence = new Sequence(sparams);
     TweenParms parms;
     parms = new TweenParms().Prop("localPosition", pos2).Ease(EaseType.Linear);
     mySequence.Append(HOTween.To(tr, 0.1f, parms));
     parms = new TweenParms().Prop("localPosition", pos3).Ease(EaseType.Linear); //.OnComplete(OnCompleteMove);
     mySequence.Append(HOTween.To(tr, 0.1f, parms));
     mySequence.Play();
 }