Beispiel #1
0
    // Use this for initialization
    void Start()
    {
        seq = action.Sequence();
        var spriteRend = GetComponent <SpriteRenderer>();

        spriteRend.enabled = true;
        spriteRend.color   = startColor;


        // Fade in out of black into splashScreen
        var spriteColorRef = ffSpriteColor;

        seq.Property(spriteColorRef, spriteColorRef.Val.MakeClear(), FFEase.E_Continuous, fadeInTime);
        seq.Sync();

        // delay for wait time
        seq.Delay(waitTime);
        seq.Sync();

        // show text
        var textColorRef = new FFRef <Color>(() => pressAnyKeyText.color, (v) => pressAnyKeyText.color = v);

        textColorRef.Setter(textColorRef.Val.MakeClear());
        seq.Property(textColorRef, textColorRef.Val.MakeOpaque(), FFEase.E_Continuous, 0.45f);

        // Update Sequence for press any key
        seq.Sync();
        seq.Call(UpdateSeq);
    }
Beispiel #2
0
        public void Property(FFRef <Color> var, Color endValue, AnimationCurve curve, float timeToComplete = CurveTime)
        {
            if (timeToComplete == CurveTime)
            {
                timeToComplete = curve.TimeToComplete();
            }

            if (_sequence.Count != 0 && var != null)
            {
                // Set Property
                FFActionProperty <Color> myprop = new FFActionProperty <Color>();
                myprop.var         = var;
                myprop.start_value = var.Val;
                myprop.end_value   = endValue;
                myprop.curr_time   = 0.0f;
                myprop.prev_value  = var.Val;

                // total_time cannot be zero
                myprop.total_time = Mathf.Max(timeToComplete, 0.01f);

                SetMuGetter <Color>(myprop, curve);

                // Add to front of sequence
                if (_sequence[_sequence.Count - 1].as_ColorProperties == null)
                {
                    _sequence[_sequence.Count - 1].as_ColorProperties = new List <FFActionProperty <Color> >();
                }
                _sequence[_sequence.Count - 1].as_ColorProperties.Add(myprop);
            }
            else
            {
                Debug.Log("Error in ActionSequence Property call");
            }
        }
Beispiel #3
0
        public void Property(FFRef <Vector4> var, Vector4 endValue, FFEase easeType, float timeToComplete)
        {
            if (_sequence.Count != 0 && var != null)
            {
                // Set Property
                FFActionProperty <Vector4> myprop = new FFActionProperty <Vector4>();
                myprop.var         = var;
                myprop.start_value = var.Val;
                myprop.end_value   = endValue;
                myprop.curr_time   = 0.0f;
                myprop.prev_value  = var.Val;

                // total_time cannot be zero
                myprop.total_time = Mathf.Max(timeToComplete, 0.01f);

                SetMuGetter <Vector4>(myprop, easeType);

                // Add to front of sequence
                if (_sequence[_sequence.Count - 1].as_Vector4Properties == null)
                {
                    _sequence[_sequence.Count - 1].as_Vector4Properties = new List <FFActionProperty <Vector4> >();
                }
                _sequence[_sequence.Count - 1].as_Vector4Properties.Add(myprop);
            }
            else
            {
                Debug.Log("Error in ActionSequence Property call");
            }
        }
    void Fade()
    {
        var sprite         = GetComponent <SpriteRenderer>();
        var spriteColorRef = new FFRef <Color>(() => sprite.color, (v) => { sprite.color = v; });

        fadeSeq.Property(spriteColorRef, spriteColorRef.Val.MakeClear(), FFEase.E_SmoothStart, fadeTime);
        fadeSeq.Sync();
        fadeSeq.Call(DestroyMe);
    }
Beispiel #5
0
 void SetVelocityRef(FFRef <Vector3> velocityRef)
 {
     Debug.Assert(velocityRef != null);
     this.velocityRef = velocityRef;
 }
Beispiel #6
0
 public void SetDynamicValue(FFRef <float> valueRef)
 {
     this.valueRef = valueRef;
 }