Files
2026-02-21 16:45:37 +08:00

53 lines
899 B
C#

using System;
using System.Collections.Generic;
using UnityEngine;
[Serializable]
public class gui_class
{
public List<float> column;
public float y;
public float x;
public gui_class(int columns)
{
column = new List<float>();
for (int i = 0; i < columns; i++)
{
column.Add(0f);
}
}
public virtual Rect getRect(int column_index, float width, float y1, bool add_width, bool add_height)
{
float num = x;
float num2 = y;
if (add_width)
{
x += width;
}
if (add_height)
{
y += y1;
}
return new Rect(column[column_index] + num, num2, width, y1);
}
public virtual Rect getRect(int column_index, float x1, float width, float y1, bool add_width, bool add_height)
{
float num = x;
float num2 = y;
if (add_width)
{
x += width + x1;
}
if (add_height)
{
y += y1;
}
return new Rect(column[column_index] + num + x1, num2, width, y1);
}
}