using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class ScrollViewItemFix : MonoBehaviour
{
    [SerializeField]
    public RectTransform reference;
    [SerializeField]
    float heitheWeight = 0.1f; //all is 1
    [SerializeField]
    float widthWeight = 1f;
    // Start is called before the first frame update
    private bool hasFixed = false;
    void Start()
    {

    }


    // Update is called once per frame
    void FixedUpdate()
    {
       
        if (!hasFixed)
        {
            GetComponent<RectTransform>().SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal, reference.rect.width * widthWeight);
            GetComponent<RectTransform>().SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, reference.rect.height * heitheWeight);
            //hasFixed = true;
        }
       
    }
}
