This commit is contained in:
JA
2026-06-20 19:34:23 +08:00
parent e5031c0068
commit d442805c3f
4136 changed files with 514641 additions and 0 deletions

View File

@@ -0,0 +1,82 @@
using Managers;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;
public class LevelItem : MonoBehaviour, IPointerClickHandler
{
public int LevelId;
public int PreId;//前置节点
public Text need;
public Text activeText;
private void Awake()
{
foreach (var date in Date.Instance.UpDate)
{
if (date.UpId == LevelId)
{
if(PlayerInfo.Instance.info.UpValue[date.UpId])
{
activeText.text = "已激活";
need.gameObject.SetActive(false);
}
else
{
activeText.text = "未激活";
need.text = date.useNum.ToString();
}
}
}
}
public void OnPointerClick(PointerEventData eventData)
{
foreach (var date in Date.Instance.UpDate)
{
if (date.UpId == LevelId&&!PlayerInfo.Instance.info.UpInfo[date.UpId])
{
if(CheckUp(LevelId))
{
if(!PlayerInfo.Instance.info.BagInfo.ContainsKey(date.userId))
{
Debug.Log("所用道具不足");
return;
}
if(PlayerInfo.Instance.info.BagInfo[date.userId]>=date.useNum)
{
PlayerInfo.Instance.BagMgr.UserItem(date.userId, date.useNum);
PlayerInfo.Instance.ItemLevel(date);
activeText.text = "已激活";
need.gameObject.SetActive(false);
//保存数据
PlayerInfo.Instance.info.UpValue[date.UpId] = true;
PlayerInfo.Instance.info.UpInfo[date.UpId] = PlayerInfo.Instance.info.UpValue[date.UpId];
SaveSystem.SaveDate(PlayerInfo.Instance.info.DatePath, PlayerInfo.Instance.info);
return;
}
Debug.Log("所用道具不足");
return;
}
Debug.Log("前置条件没有升级");
}
}
}
bool CheckUp(int id)
{
if(id==0)
{
return true;
}
if(!PlayerInfo.Instance.info.UpValue[Date.Instance.UpDate[id].PreId])
{
return false;
}
return true;
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 2e8febb475782074d92ed6e2d7d41a8a
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,17 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class LevelUpDefine
{
public int UpId;
public int PreId;
public string UpName;
public bool Active;
public string Descripet;
public int userId;
public int useNum;
public LotteryType type;
public int value;
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: d2221f9aac6ce9c45818de80359b75bf
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,7 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class UILevelUp : UIWindow
{
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 29cd9dd5f7ca389448a41d0f0f308267
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: