示例#1
0
    public async void SetData(
        UIPopupManager parent,
        Vector3 worldPos,
        float value)
    {
        _parent   = parent;
        _worldPos = worldPos;

        transform.RectTf().anchoredPosition =
            parent.ConvertWorldPosToUIPos(_worldPos);

        Text.text  = value.ToString("0.0");
        Text.color = value > 0 ? AddColor : SubColor;

        gameObject.SetActive(true);

        await Task.Delay(500);

        if (gameObject == null)
        {
            return;
        }

        parent.PopupItemPool.Recycle(this);
    }
示例#2
0
 private void LateUpdate()
 {
     transform.RectTf().anchoredPosition =
         _parent.ConvertWorldPosToUIPos(_worldPos);
 }