Shegotwet/Assets/Scripts/Util/SetBannerPos.cs

22 lines
707 B
C#
Raw Normal View History

using System.Collections.Generic;
using UnityEngine;
public class SetBannerPos : MonoBehaviour
{
static List<SetBannerPos> list_SetBannerPos = new List<SetBannerPos>();
2025-09-21 22:03:42 +00:00
public static void Run() { list_SetBannerPos.ForEach(f => f.Start()); }
2025-09-21 22:03:42 +00:00
private void Awake() { list_SetBannerPos.Add(this); }
2025-09-16 20:55:48 +00:00
[Header("Need Full Rect")]
public bool BannerPosIsBottom = true;
private void Start()
{
var rt = GetComponent<RectTransform>();
if (BannerPosIsBottom)
2025-09-25 04:20:13 +00:00
rt.offsetMin = new Vector2(rt.offsetMin.x, SaveMgr.Ins.Get_ShopNoAD() ? 0f : 150f);
else
2025-09-25 04:20:13 +00:00
rt.offsetMax = new Vector2(rt.offsetMax.x, SaveMgr.Ins.Get_ShopNoAD() ? 0f : -150f);
}
}