mycj_demo/mycj/Assets/Script/paotaInfo.cs

51 lines
1.2 KiB
C#
Raw Permalink Normal View History

2024-12-02 09:37:47 +08:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class paotaInfo : MonoBehaviour
{
[Header("<22><>Χ<EFBFBD><CEA7>ʾ")]
public RectTransform fanwei;
[Header("2dԲ<64><D4B2><EFBFBD><EFBFBD>ײ<EFBFBD><D7B2>")]
public CircleCollider2D _CircleCollider2D;
[Header("<22><>Χֵ<CEA7><D6B5>ָ<EFBFBD>뾶")]
public float fanweiNumber;
public Button UpBTN;
// Start is called before the first frame update
void Start()
{
Init();
2024-12-02 23:38:32 +08:00
//UpBTN.onClick.AddListener(()=> {
// UpLevel();
////});
//UpBTN.gameObject.SetActive(false);
2024-12-02 09:37:47 +08:00
2024-12-02 23:38:32 +08:00
//PlayerInfo.instance.OnGoldReachedThreshold += ShowUpBTN;
2024-12-02 09:37:47 +08:00
}
private void OnDestroy()
{
2024-12-02 23:38:32 +08:00
// PlayerInfo.instance.OnGoldReachedThreshold -= ShowUpBTN;
2024-12-02 09:37:47 +08:00
}
void ShowUpBTN() {
UpBTN.gameObject.SetActive(true);
}
public void Init()
{
fanwei.sizeDelta = new Vector2(fanweiNumber*2, fanweiNumber * 2);
_CircleCollider2D.radius = fanweiNumber;
}
2024-12-02 23:38:32 +08:00
public void UpLevel()
2024-12-02 09:37:47 +08:00
{
float a = fanweiNumber * 1.5f;
fanwei.sizeDelta = new Vector2(a * 2f, a * 2f);
_CircleCollider2D.radius = a;
2024-12-02 23:38:32 +08:00
Progress_Display.Instance.huadongClick(-3);
2024-12-02 09:37:47 +08:00
}
}