备份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,61 @@
using asap.core;
using cfg;
using GameCore;
using System;
using System.Collections.Generic;
using UnityEngine;
using UniRx;
public class GetCurSelectMapEvent
{
public int type;//0获得当前选中的地图1更新当前选中的地图
public MapData selectMap;
}
public class PlayerGradeProgress : MonoBehaviour
{
GameObject item;
Transform content;
List<GradeMapItem> gradeMapItems = new List<GradeMapItem>();
GradeMapItem selectMap;
IDisposable disposable;
private void Awake()
{
disposable = GContext.OnEvent<GetCurSelectMapEvent>().Subscribe(GetCurSelectMap);
item = transform.Find("ScrollView/Viewport/Content/Item").gameObject;
content = transform.Find("ScrollView/Viewport/Content");
item.SetActive(false);
}
private void Start()
{
var DataMap = GContext.container.Resolve<Tables>().TbMapData.DataMap;
int requireLevel = 0;
foreach (var mapData in DataMap.Values)
{
GameObject go = Instantiate(item, content);
GradeMapItem gradeMapItem = go.GetComponent<GradeMapItem>();
gradeMapItems.Add(gradeMapItem);
gradeMapItem.GetComponent<GradeMapItem>().SetData(mapData, requireLevel, OnClickMap);
requireLevel = mapData.LevelRequired;
}
}
async void OnClickMap(GradeMapItem gradeMapItem)
{
selectMap = gradeMapItem;
await UIManager.Instance.ShowUI(UITypes.PlayerGradeAquariumPanel);
}
void GetCurSelectMap(GetCurSelectMapEvent getCurSelectMapEvent)
{
if (getCurSelectMapEvent.type == 0)
{
getCurSelectMapEvent.selectMap = selectMap.mapData;
}
else
{
selectMap.Refresh();
}
}
private void OnDestroy()
{
disposable?.Dispose();
disposable = null;
}
}