备份CatanBuilding瘦身独立工程

This commit is contained in:
JSD\13999
2026-05-26 16:15:54 +08:00
commit 2d0e6a61b7
12001 changed files with 2431925 additions and 0 deletions

View File

@@ -0,0 +1,46 @@
using GameCore;
using UnityEngine;
using UnityEngine.UI;
class PeakItem : PanelItemBase<PeakItemData>
{
public Button btn_item;
public Perk perk;
private void Awake()
{
btn_item = transform.GetComponent<Button>();
perk = transform.GetComponent<Perk>();
}
private void Start()
{
btn_item.onClick.AddListener(OnBtnItem);
}
public override void OnInit()
{
transform.localScale = Vector3.one * 0.75f;
}
public override void OffsetX(float _offsetX, float width)
{
transform.localScale = Vector3.one * Mathf.Clamp(1 - Mathf.Abs(_offsetX) / width * 0.2f, 0.75f, 1);
float offset;
if (transform.localScale.x < 0.8f)
{
offset = (0.8f - transform.localScale.x) * width * 3;
}
else
{
offset = 0;
}
transform.GetChild(0).localPosition = _offsetX > 0 ? Vector3.left * offset : Vector3.right * offset;
}
}
public class PeakItemData
{
public int id;
}