unitytools/Assets/UnityTools/script/NormalPopUpWindow.cs

38 lines
919 B
C#
Raw Normal View History

2024-11-12 00:30:33 +08:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public enum ModeEnum//<2F><><EFBFBD><EFBFBD>ģʽö<CABD><C3B6>
{
autofill = 0,//<2F>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD>
fixedSize = 1,//<2F>̶<EFBFBD><CCB6><EFBFBD>С
}
public class NormalPopUpWindow : MonoBehaviour
{
public ModeEnum Mode = ModeEnum.autofill;//<2F><><EFBFBD><EFBFBD>ģʽ
public void setMinimumHeight(int value) {
minimumHeight = value;
GetComponent<LayoutElement>().minHeight = minimumHeight;
Debug.Log(GetComponent<LayoutElement>().minHeight);
}
private int minimumHeight = -1;//<2F><>С<EFBFBD>߶<EFBFBD>
public void setMinimumWidth(int value)
{
minimumWidth = value;
GetComponent<LayoutElement>().minWidth = minimumWidth;
Debug.Log(GetComponent<LayoutElement>().minWidth);
}
private int minimumWidth = -1;//<2F><>С<EFBFBD><D0A1><EFBFBD><EFBFBD>
void Start()
{
}
// Update is called once per frame
void Update()
{
}
}