Exemple #1
0
    void Act_RandomPosition()
    {
        float to = Random.Range(-5f, 5f);

        EzTween.TweenAct(this, ezEaseType, targetTrans.localPosition.x, to, 1, (v) => {
            targetTrans.localPosition = new Vector3(v, 0, 0);
        }, () => {
            Debug.Log("Complete_Act_RandomPosition");
        });
    }
Exemple #2
0
    void Act_RandomScale()
    {
        float to = Random.Range(1f, 5f);

        EzTween.TweenAct(targetTrans, ezEaseType, targetTrans.localScale.x, to, 1, (v) => {
            targetTrans.localScale = Vector3.one * v;
        }, () => {
            Debug.Log("Complete_Act_RandomScale");
        });
    }
Exemple #3
0
    void Act_RandomScaleAnimCurve()
    {
        Vector3 to = Vector3.one * Random.Range(1f, 5f);

        EzTween.TweenAct(targetTrans, animationCurve, targetTrans.localScale, to, 1, (v) => {
            targetTrans.localScale = v;
        }, () => {
            Debug.Log("Complete_Act_Act_RandomScaleAnimCurve");
        });
    }
Exemple #4
0
    void Act_RandomSizeDelta()
    {
        float   time = Random.Range(0.5f, 2f);
        Vector2 to   = Vector2.one * Random.Range(0, 300f);

        EzTween.TweenAct(targetRectTrans, ezEaseType, targetRectTrans.sizeDelta, to, time, (v) => {
            targetRectTrans.sizeDelta = v;
        }, () => {
            Debug.Log("Complete_Act_RandomPositionA");
        });
    }
Exemple #5
0
    void Act_RandomRot()
    {
        //Quaternion to = Quaternion.LookRotation(Random.onUnitSphere);
        Quaternion to = Random.rotationUniform;

        EzTween.TweenAct(this, ezEaseType, targetTrans.rotation, to, 1, (v) => {
            targetTrans.rotation = v;
        }, () => {
            Debug.Log("Complete_Act_RandomRot");
        });
    }
Exemple #6
0
    void Act_RandomColor()
    {
        Color    to        = Random.ColorHSV();
        Renderer _renderer = targetTrans.GetComponent <Renderer>();

        EzTween.TweenAct(this, ezEaseType, _renderer.material.color, to, 1, (v) => {
            _renderer.material.color = v;
        }, () => {
            Debug.Log("Complete_Act_RandomColor");
        });
    }
Exemple #7
0
    void Act_RandomColor()
    {
        float time = Random.Range(0.5f, 2f);
        Color to   = Random.ColorHSV();

        EzTween.TweenAct(image, ezEaseType, image.color, to, time, (v) => {
            image.color = v;
        }, () => {
            Debug.Log("Complete_Act_RandomPositionA");
        });
    }
Exemple #8
0
    void Act_RandomPosition()
    {
        float   time = Random.Range(0.5f, 2f);
        Vector2 to   = Random.insideUnitSphere * Random.Range(0, 400f);

        EzTween.TweenAct(targetRectTrans, ezEaseType, targetRectTrans.anchoredPosition, to, time, (v) => {
            targetRectTrans.anchoredPosition = v;
        }, () => {
            Debug.Log("Complete_Act_RandomPositionA");
        });
    }
Exemple #9
0
    void Cancel()
    {
        EzTween.Cancel(targetTransA);
        EzTween.Cancel(targetTransB);

        Renderer rendererA = targetTransA.GetComponent <Renderer>();

        EzTween.Cancel(rendererA);
        Renderer rendererB = targetTransB.GetComponent <Renderer>();

        EzTween.Cancel(rendererB);
    }
Exemple #10
0
    IEnumerator Act_Chain3()
    {
        Vector3 to1 = Random.insideUnitSphere * Random.Range(0, 5f);

        yield return(EzTween.TweenLocalPosition(targetTrans, EzEaseType.Linear, to1, 1));

        yield return(new WaitForSeconds(1.0f)); // delay

        Vector3 to2 = Vector3.one * Random.Range(1f, 5f);

        yield return(EzTween.TweenScale(targetTrans, EzEaseType.Linear, to2, 1));

        Debug.Log("complete");
    }
Exemple #11
0
    void Act_ToScale()
    {
        Vector3 to = Vector3.one * Random.Range(1f, 5f);

        EzTween.TweenAct(targetTrans, ezEaseType, targetTrans.localScale, to, 1, (v) => {
            targetTrans.localScale = v;
        }, () => {
            Debug.Log("Complete_Act_ToScale");
        });
        //EzTween.TweenAct(this.transform, ezEaseType, this.transform.localScale.x, toScale, 1, (v) => {
        //    this.transform.localScale = Vector3.one * v;
        //}, () => {
        //    Debug.Log("Complete_Act_RandomScale");
        //});
    }
Exemple #12
0
    void Act_RandomPosition()
    {
        float   timeA = Random.Range(0.5f, 2f);
        Vector3 toA   = Random.insideUnitSphere * Random.Range(0, 5f);

        EzTween.TweenLocalPosition(targetTransA, ezEaseType, toA, timeA, () => {
            Debug.Log("Complete_Act_RandomPositionA");
        });

        float   timeB = Random.Range(0.5f, 2f);
        Vector3 toB   = Random.insideUnitSphere * Random.Range(0, 5f);

        EzTween.TweenLocalPosition(targetTransB, ezEaseType, toB, timeB, () => {
            Debug.Log("Complete_Act_RandomPositionB");
        });
    }
Exemple #13
0
    void Act_RandomColor()
    {
        float    timeA     = 1;
        Color    toA       = Random.ColorHSV();
        Renderer rendererA = targetTransA.GetComponent <Renderer>();

        EzTween.TweenRendererColor(rendererA, ezEaseType, toA, timeA, () => {
            Debug.Log("Complete_Act_RandomColorA");
        });

        float    timeB     = 2;
        Color    toB       = Random.ColorHSV();
        Renderer rendererB = targetTransB.GetComponent <Renderer>();

        EzTween.TweenRendererColor(rendererB, ezEaseType, toB, timeB, () => {
            Debug.Log("Complete_Act_RandomColorB");
        });
    }
Exemple #14
0
    IEnumerator Act_Chain()
    {
        float to = Random.Range(-5f, 5f);

        yield return(EzTween.TweenAct(this, ezEaseType, targetTrans.localPosition.x, to, 1, (v) => {
            targetTrans.localPosition = new Vector3(v, 0, 0);
        }, () => {
            Debug.Log("Complete_Act_Chain_pos");
        }));

        yield return(new WaitForSeconds(1.0f)); // delay

        float to2 = Random.Range(1f, 5f);

        yield return(EzTween.TweenAct(targetTrans, ezEaseType, targetTrans.localScale.x, to2, 1, (v) => {
            targetTrans.localScale = Vector3.one * v;
        }, () => {
            Debug.Log("Complete_Act_Chain_scale");
        }));
    }
Exemple #15
0
    void Act_Chain2()
    {
        float to = Random.Range(-5f, 5f);

        EzTween.TweenAct(this, ezEaseType, targetTrans.localPosition.x, to, 1, (v) => {
            targetTrans.localPosition = new Vector3(v, 0, 0);
        }, () => {
            Debug.Log("Complete_Act_Chain_pos");
            float to2 = Random.Range(1f, 5f);
            EzTween.TweenAct(targetTrans, ezEaseType, targetTrans.localScale.x, to2, 1, (v) => {
                targetTrans.localScale = Vector3.one * v;
            }, () => {
                Debug.Log("Complete_Act_Chain_scale");
                //
                EzTween.TweenAct(this, ezEaseType, targetTrans.localPosition.x, Random.Range(-5f, 5f), 1, (v) => {
                    targetTrans.localPosition = new Vector3(v, 0, 0);
                }, () => {
                    Debug.Log("Complete_Act_Chain_pos");
                });
            });
        });
    }
Exemple #16
0
 void CancelAll()
 {
     EzTween.CancelAll();
 }
Exemple #17
0
 void Cancel()
 {
     EzTween.Cancel(targetRectTrans);
     EzTween.Cancel(image);
 }
Exemple #18
0
 //
 void Awake()
 {
     _INSTANCE = this;
     tweenDic  = new Dictionary <Object, Coroutine>();
 }