wangguan
2020-12-02 d7d30d2e665aa451f8bd3ea3c8b15391b765ccc3
Assets/Scripts/UI/FinalPanel/FinalPanelItem.cs
@@ -1,4 +1,6 @@
using UnityEngine.UI;
using System.Drawing;
using UnityEngine;
using UnityEngine.UI;
using EnhancedUI.EnhancedScroller;
using TMPro;
using DG.Tweening;
@@ -11,6 +13,19 @@
    public Image icon;
    public Image backGround;
    private RectTransform rt;
    /// <summary>
    /// Start is called on the frame when a script is enabled just before
    /// any of the Update methods is called the first time.
    /// </summary>
    void Awake()
    {
        offect = Vector3.zero;
        rt = transform.GetComponent<RectTransform>();
    }
    Vector3 offect;
    public void SetData(FinalPanelItemData data)
    {
        playerNameTxt.text = data.playerName;
@@ -27,7 +42,13 @@
            indexTxt.text = data.index.ToString();
        }
        backGround.sprite = data.spriteBackGround;
        if (rt != null)
        {
            offect.x = rt.anchoredPosition3D.x;
            offect.y = rt.anchoredPosition3D.y;
            rt.anchoredPosition3D = offect;
        }
    }
    public void SetPos()
@@ -37,7 +58,8 @@
    public void PlayDoTween(float duration)
    {
        Sequence agentTweenSeq = DOTween.Sequence();
        agentTweenSeq.Append(backGround.rectTransform.DOAnchorPosX(0, duration));
        //Sequence agentTweenSeq = DOTween.Sequence();
        //agentTweenSeq.Join(backGround.rectTransform.DOAnchorPosX(0, duration));
        backGround.rectTransform.DOAnchorPosX(0, duration);
    }
}