19 lines
558 B
C#
19 lines
558 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using Unity.VisualScripting;
|
|
using UnityEditor.VersionControl;
|
|
using UnityEngine;
|
|
|
|
public class ImgaeSizeSet : MonoBehaviour
|
|
{
|
|
|
|
private void Start()
|
|
{
|
|
RectTransform rt = gameObject.GetComponent<RectTransform>();
|
|
RectTransform changeRt = gameObject.GetComponentsInChildren<RectTransform>()[1];
|
|
float sizeSet = (rt.sizeDelta.y / 2) - 10;
|
|
changeRt.offsetMin = new Vector2(-sizeSet, 10.0f);
|
|
changeRt.offsetMax = new Vector2(sizeSet, -10.0f);
|
|
}
|
|
}
|