コード例 #1
0
    void Awake()
    {
        // Save our start position
        Vector2 startPos = RectTransform.anchoredPosition;

        // Save our end position
        Vector2 endPos = new Vector2(startPos.x, startPos.y + 300f);

        /*
         * // Create a QuadraticInOut Tween
         * m_OpenTween = EZTween.QuadraticInOut(m_MoveDuration, t => {
         *  // On every update we lerp our position based on the t
         *  RectTransform.anchoredPosition = Vector2.Lerp(startPos, endPos, t);
         * }).OnComplete(() => {
         *  // When the Tween is done, we move back to the start position
         *  RectTransform.anchoredPosition = startPos;
         * });
         * //*/

        m_OpenTween = EZTween.CubicOut(m_MoveDuration, t =>
        {
            // On every update we lerp our position based on the t
            RectTransform.anchoredPosition = Vector2.LerpUnclamped(startPos, endPos, t);
        }).OnComplete(() => {
            // When the Tween is done, we move back to the start position
            RectTransform.anchoredPosition = startPos;
        });
    }
コード例 #2
0
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.Space))
        {
            //Debug.Log("Open Tween Playing");
            openTween.Play();

            EZTween.QuadraticInOut(10f, t => {
            }).Play("ID");
        }
    }
コード例 #3
0
    // Start is called before the first frame update
    void Start()
    {
        Tween tween = EZTween.Linear(2f, t => {
        }).OnComplete(() => {
            //Debug.Log("Done!");
        });

        //tween.Play();
        //tween.Pause();
        //tween.Stop();
        //tween.Restart();

        //EZTween.QuadraticInOut(1f, t => {
        //Debug.Log(t);
        //}).Play();
    }
コード例 #4
0
 private void Awake()
 {
     EZTween.Init();
 }