资源目录调整

This commit is contained in:
2025-11-23 10:46:34 +08:00
parent 4ac44848aa
commit 523c9550fe
60 changed files with 2449 additions and 408 deletions

View File

@@ -0,0 +1,101 @@
using System;
using ProtoBuf;
using Fantasy;
using System.Linq;
using System.Reflection;
using System.Collections.Generic;
using System.Collections.Concurrent;
using NBC;
using Fantasy.Serialize;
namespace NBF
{
[ProtoContract]
public sealed partial class GoodsConfig : ASerialize, IConfigTable
{
[ProtoMember(1)]
public uint Id { get; set; } // Id
[ProtoMember(2)]
public uint Type { get; set; } // 子类型
[ProtoMember(3)]
public uint[] Shop { get; set; } = Array.Empty<uint>(); // 出现商店
[ProtoMember(4)]
public uint Group { get; set; } // 组
[ProtoMember(5)]
public uint[] Items { get; set; } = Array.Empty<uint>(); // 物品
[ProtoMember(6)]
public uint Amount { get; set; } // 获得数量
[ProtoMember(7)]
public uint Price1 { get; set; } // 银币价格
[ProtoMember(8)]
public uint Price2 { get; set; } // 金币价格
[ProtoMember(9)]
public uint[] Label { get; set; } = Array.Empty<uint>(); // 标签
[ProtoMember(10)]
public uint Number { get; set; } // 可购买数量
[ProtoMember(11)]
public uint Disable { get; set; } // 禁用状态
[ProtoIgnore]
public uint Key => Id;
#region Static
private static ConfigContext<GoodsConfig> Context => ConfigTableHelper.Table<GoodsConfig>();
public static GoodsConfig Get(uint key)
{
return Context.Get(key);
}
public static GoodsConfig Get(Predicate<GoodsConfig> match)
{
return Context.Get(match);
}
public static GoodsConfig Fist()
{
return Context.Fist();
}
public static GoodsConfig Last()
{
return Context.Last();
}
public static GoodsConfig Fist(Predicate<GoodsConfig> match)
{
return Context.Fist(match);
}
public static GoodsConfig Last(Predicate<GoodsConfig> match)
{
return Context.Last(match);
}
public static int Count()
{
return Context.Count();
}
public static int Count(Func<GoodsConfig, bool> predicate)
{
return Context.Count(predicate);
}
public static List<GoodsConfig> GetList()
{
return Context.GetList();
}
public static List<GoodsConfig> GetList(Predicate<GoodsConfig> match)
{
return Context.GetList(match);
}
public static void ParseJson(Newtonsoft.Json.Linq.JArray arr)
{
ConfigTableHelper.ParseLine<GoodsConfig>(arr);
}
#endregion
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 1db26de84347d9f46ad4b4f07775c91e

View File

@@ -257,6 +257,38 @@ namespace Fantasy
public int Abrasion { get; set; }
}
/// <summary>
/// 商店物品信息
/// </summary>
[ProtoContract]
public partial class ShopItemInfo : AMessage
{
public static ShopItemInfo Create(Scene scene)
{
return scene.MessagePoolComponent.Rent<ShopItemInfo>();
}
public override void Dispose()
{
ConfigId = default;
Price = default;
Currency = default;
Sort = default;
Tag = default;
#if FANTASY_NET || FANTASY_UNITY
GetScene().MessagePoolComponent.Return<ShopItemInfo>(this);
#endif
}
[ProtoMember(1)]
public uint ConfigId { get; set; }
[ProtoMember(2)]
public uint Price { get; set; }
[ProtoMember(3)]
public uint Currency { get; set; }
[ProtoMember(4)]
public uint Sort { get; set; }
[ProtoMember(5)]
public uint Tag { get; set; }
}
/// <summary>
/// fish信息
/// </summary>
[ProtoContract]

View File

@@ -383,6 +383,55 @@ namespace Fantasy
/// /////////// ******** 商店 *******/////////////
/// </summary>
/// <summary>
/// 请求商店商品列表
/// </summary>
[ProtoContract]
public partial class C2Game_GetShopItemsRequest : AMessage, ICustomRouteRequest
{
public static C2Game_GetShopItemsRequest Create(Scene scene)
{
return scene.MessagePoolComponent.Rent<C2Game_GetShopItemsRequest>();
}
public override void Dispose()
{
Shop = default;
#if FANTASY_NET || FANTASY_UNITY
GetScene().MessagePoolComponent.Return<C2Game_GetShopItemsRequest>(this);
#endif
}
[ProtoIgnore]
public Game2C_GetShopItemsResponse ResponseType { get; set; }
public uint OpCode() { return OuterOpcode.C2Game_GetShopItemsRequest; }
[ProtoIgnore]
public int RouteType => Fantasy.RouteType.GameRoute;
[ProtoMember(1)]
public uint Shop { get; set; }
}
/// <summary>
/// 请求商店商品列表响应
/// </summary>
[ProtoContract]
public partial class Game2C_GetShopItemsResponse : AMessage, ICustomRouteResponse
{
public static Game2C_GetShopItemsResponse Create(Scene scene)
{
return scene.MessagePoolComponent.Rent<Game2C_GetShopItemsResponse>();
}
public override void Dispose()
{
ErrorCode = default;
Items.Clear();
#if FANTASY_NET || FANTASY_UNITY
GetScene().MessagePoolComponent.Return<Game2C_GetShopItemsResponse>(this);
#endif
}
public uint OpCode() { return OuterOpcode.Game2C_GetShopItemsResponse; }
[ProtoMember(1)]
public List<ShopItemInfo> Items = new List<ShopItemInfo>();
[ProtoMember(2)]
public uint ErrorCode { get; set; }
}
/// <summary>
/// 请求购买
/// </summary>
[ProtoContract]
@@ -394,6 +443,7 @@ namespace Fantasy
}
public override void Dispose()
{
BuyId = default;
#if FANTASY_NET || FANTASY_UNITY
GetScene().MessagePoolComponent.Return<C2Game_BuyRequest>(this);
#endif
@@ -403,6 +453,8 @@ namespace Fantasy
public uint OpCode() { return OuterOpcode.C2Game_BuyRequest; }
[ProtoIgnore]
public int RouteType => Fantasy.RouteType.GameRoute;
[ProtoMember(1)]
public uint BuyId { get; set; }
}
/// <summary>
/// 请求购买响应
@@ -417,16 +469,36 @@ namespace Fantasy
public override void Dispose()
{
ErrorCode = default;
Awards.Clear();
#if FANTASY_NET || FANTASY_UNITY
GetScene().MessagePoolComponent.Return<Game2C_BuyResponse>(this);
#endif
}
public uint OpCode() { return OuterOpcode.Game2C_BuyResponse; }
[ProtoMember(1)]
public List<AwardInfo> Awards = new List<AwardInfo>();
[ProtoMember(2)]
public uint ErrorCode { get; set; }
}
/// <summary>
/// 活动奖励推送
/// </summary>
[ProtoContract]
public partial class Game2C_RewardNotify : AMessage, ICustomRouteMessage
{
public static Game2C_RewardNotify Create(Scene scene)
{
return scene.MessagePoolComponent.Rent<Game2C_RewardNotify>();
}
public override void Dispose()
{
Awards.Clear();
#if FANTASY_NET || FANTASY_UNITY
GetScene().MessagePoolComponent.Return<Game2C_RewardNotify>(this);
#endif
}
public uint OpCode() { return OuterOpcode.Game2C_RewardNotify; }
[ProtoIgnore]
public int RouteType => Fantasy.RouteType.GameRoute;
[ProtoMember(1)]
public List<AwardInfo> Awards = new List<AwardInfo>();
}
}

View File

@@ -126,6 +126,20 @@ namespace Fantasy
return (Game2C_SellFishResponse)await session.Call(request);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static async FTask<Game2C_GetShopItemsResponse> C2Game_GetShopItemsRequest(this Session session, C2Game_GetShopItemsRequest request)
{
return (Game2C_GetShopItemsResponse)await session.Call(request);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static async FTask<Game2C_GetShopItemsResponse> C2Game_GetShopItemsRequest(this Session session, uint shop)
{
using var request = Fantasy.C2Game_GetShopItemsRequest.Create(session.Scene);
request.Shop = shop;
return (Game2C_GetShopItemsResponse)await session.Call(request);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static async FTask<Game2C_GetFishsResponse> C2Game_BuyRequest(this Session session, C2Game_BuyRequest request)
{
@@ -133,12 +147,27 @@ namespace Fantasy
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static async FTask<Game2C_GetFishsResponse> C2Game_BuyRequest(this Session session)
public static async FTask<Game2C_GetFishsResponse> C2Game_BuyRequest(this Session session, uint buyId)
{
using var request = Fantasy.C2Game_BuyRequest.Create(session.Scene);
request.BuyId = buyId;
return (Game2C_GetFishsResponse)await session.Call(request);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static void Game2C_RewardNotify(this Session session, Game2C_RewardNotify message)
{
session.Send(message);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static void Game2C_RewardNotify(this Session session, List<AwardInfo> awards)
{
using var message = Fantasy.Game2C_RewardNotify.Create(session.Scene);
message.Awards = awards;
session.Send(message);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static async FTask<Map2C_CreateRoomResponse> C2Map_CreateRoomRequest(this Session session, C2Map_CreateRoomRequest request)
{

View File

@@ -16,63 +16,66 @@ namespace Fantasy
public const uint Game2C_FishChange = 2147493650;
public const uint C2Game_SellFishRequest = 2281711382;
public const uint Game2C_SellFishResponse = 2415929110;
public const uint C2Game_BuyRequest = 2281711383;
public const uint Game2C_BuyResponse = 2415929111;
public const uint C2Map_CreateRoomRequest = 2281711384;
public const uint Map2C_CreateRoomResponse = 2415929112;
public const uint C2Game_GetShopItemsRequest = 2281711383;
public const uint Game2C_GetShopItemsResponse = 2415929111;
public const uint C2Game_BuyRequest = 2281711384;
public const uint Game2C_BuyResponse = 2415929112;
public const uint Game2C_RewardNotify = 2147493651;
public const uint C2Map_CreateRoomRequest = 2281711385;
public const uint Map2C_CreateRoomResponse = 2415929113;
public const uint C2G_ExitRoomRequest = 268445457;
public const uint G2C_ExitRoomResponse = 402663185;
public const uint C2G_EnterMapRequest = 268445458;
public const uint G2C_EnterMapResponse = 402663186;
public const uint Map2C_ChangeMap = 2147493651;
public const uint Map2C_ChangeMap = 2147493652;
public const uint C2A_LoginRequest = 268445459;
public const uint A2C_LoginResponse = 402663187;
public const uint C2G_LoginRequest = 268445460;
public const uint G2C_LoginResponse = 402663188;
public const uint G2C_RepeatLogin = 134227729;
public const uint C2Game_GetRoleInfoRequest = 2281711385;
public const uint Game2C_GetRoleInfoResponse = 2415929113;
public const uint Map2C_RoleEnterRoomNotify = 2147493652;
public const uint Map2C_RoleExitRoomNotify = 2147493653;
public const uint C2Map_RolePropertyChange = 2147493654;
public const uint Map2C_RoleStateNotify = 2147493655;
public const uint Map2C_RoleGearChangeNotify = 2147493656;
public const uint Map2C_RolePropertyChangeNotify = 2147493657;
public const uint C2Map_Move = 2147493658;
public const uint C2Map_Look = 2147493659;
public const uint Map2C_MoveNotify = 2147493660;
public const uint Map2C_LookeNotify = 2147493661;
public const uint C2S_GetConversationsRequest = 2281711386;
public const uint S2C_GetConversationsResponse = 2415929114;
public const uint C2S_SendMailRequest = 2281711387;
public const uint S2C_SendMailResponse = 2415929115;
public const uint C2S_DeleteMailRequest = 2281711388;
public const uint S2C_DeleteMailResponse = 2415929116;
public const uint S2C_HaveMail = 2147493662;
public const uint S2C_MailState = 2147493663;
public const uint C2S_CreateChannelRequest = 2281711389;
public const uint S2C_CreateChannelResponse = 2415929117;
public const uint C2S_JoinChannelRequest = 2281711390;
public const uint S2C_JoinChannelResponse = 2415929118;
public const uint C2S_SendMessageRequest = 2281711391;
public const uint S2C_SendMessageResponse = 2415929119;
public const uint S2C_Message = 2147493664;
public const uint C2S_CreateClubRequest = 2281711392;
public const uint S2C_CreateClubResponse = 2415929120;
public const uint C2S_GetClubInfoRequest = 2281711393;
public const uint S2C_GetClubInfoResponse = 2415929121;
public const uint C2S_GetMemberListRequest = 2281711394;
public const uint S2C_GetMemberListResponse = 2415929122;
public const uint C2S_GetClubListRequest = 2281711395;
public const uint S2C_GetClubListResponse = 2415929123;
public const uint C2S_JoinClubRequest = 2281711396;
public const uint S2C_JoinClubResponse = 2415929124;
public const uint C2S_LeaveClubRequest = 2281711397;
public const uint S2C_LeaveClubResponse = 2415929125;
public const uint C2S_DissolveClubRequest = 2281711398;
public const uint S2C_DissolveClubResponse = 2415929126;
public const uint C2S_DisposeJoinRequest = 2281711399;
public const uint S2C_DisposeJoinResponse = 2415929127;
public const uint S2C_ClubChange = 2147493665;
public const uint C2Game_GetRoleInfoRequest = 2281711386;
public const uint Game2C_GetRoleInfoResponse = 2415929114;
public const uint Map2C_RoleEnterRoomNotify = 2147493653;
public const uint Map2C_RoleExitRoomNotify = 2147493654;
public const uint C2Map_RolePropertyChange = 2147493655;
public const uint Map2C_RoleStateNotify = 2147493656;
public const uint Map2C_RoleGearChangeNotify = 2147493657;
public const uint Map2C_RolePropertyChangeNotify = 2147493658;
public const uint C2Map_Move = 2147493659;
public const uint C2Map_Look = 2147493660;
public const uint Map2C_MoveNotify = 2147493661;
public const uint Map2C_LookeNotify = 2147493662;
public const uint C2S_GetConversationsRequest = 2281711387;
public const uint S2C_GetConversationsResponse = 2415929115;
public const uint C2S_SendMailRequest = 2281711388;
public const uint S2C_SendMailResponse = 2415929116;
public const uint C2S_DeleteMailRequest = 2281711389;
public const uint S2C_DeleteMailResponse = 2415929117;
public const uint S2C_HaveMail = 2147493663;
public const uint S2C_MailState = 2147493664;
public const uint C2S_CreateChannelRequest = 2281711390;
public const uint S2C_CreateChannelResponse = 2415929118;
public const uint C2S_JoinChannelRequest = 2281711391;
public const uint S2C_JoinChannelResponse = 2415929119;
public const uint C2S_SendMessageRequest = 2281711392;
public const uint S2C_SendMessageResponse = 2415929120;
public const uint S2C_Message = 2147493665;
public const uint C2S_CreateClubRequest = 2281711393;
public const uint S2C_CreateClubResponse = 2415929121;
public const uint C2S_GetClubInfoRequest = 2281711394;
public const uint S2C_GetClubInfoResponse = 2415929122;
public const uint C2S_GetMemberListRequest = 2281711395;
public const uint S2C_GetMemberListResponse = 2415929123;
public const uint C2S_GetClubListRequest = 2281711396;
public const uint S2C_GetClubListResponse = 2415929124;
public const uint C2S_JoinClubRequest = 2281711397;
public const uint S2C_JoinClubResponse = 2415929125;
public const uint C2S_LeaveClubRequest = 2281711398;
public const uint S2C_LeaveClubResponse = 2415929126;
public const uint C2S_DissolveClubRequest = 2281711399;
public const uint S2C_DissolveClubResponse = 2415929127;
public const uint C2S_DisposeJoinRequest = 2281711400;
public const uint S2C_DisposeJoinResponse = 2415929128;
public const uint S2C_ClubChange = 2147493666;
}
}

View File

@@ -96,6 +96,7 @@ namespace NBF
private void AddUIPackages()
{
App.UI.AddPackage("Common/Common");
App.UI.AddPackage("CommonNew/CommonNew");
App.UI.AddPackage("CommonFlag/CommonFlag");
App.UI.AddPackage("CommonIcon/CommonIcon");
}

View File

@@ -9,7 +9,7 @@ namespace NBF
[UIExtensionAutoBind]
public static void BindAll()
{
UIObjectFactory.SetPackageItemExtension(ShopGearItem.URL, typeof(ShopGearItem));
UIObjectFactory.SetPackageItemExtension(ShopItem.URL, typeof(ShopItem));
}
}
}

View File

@@ -129,9 +129,9 @@ namespace NBF
{
var itemData = _listData[index];
if (itemData is ShopGearData)
if (itemData is ShopItemInfo)
{
return ShopGearItem.URL;
return ShopItem.URL;
}
if (itemData is ItemInfo itemInfo)

View File

@@ -0,0 +1,28 @@
/**注册组件绑定关系。本脚本为自动生成每次生成会覆盖请勿手动修改生成插件文档及项目地址https://git.whoot.com/whoot-games/whoot.fguieditorplugin**/
using FairyGUI;
namespace NBF
{
public static class Common2Binder
{
[UIExtensionAutoBind]
public static void BindAll()
{
UIObjectFactory.SetPackageItemExtension(SelectPages.URL, typeof(SelectPages));
UIObjectFactory.SetPackageItemExtension(BottomMenu.URL, typeof(BottomMenu));
UIObjectFactory.SetPackageItemExtension(CommonInput.URL, typeof(CommonInput));
UIObjectFactory.SetPackageItemExtension(ClassifyList.URL, typeof(ClassifyList));
UIObjectFactory.SetPackageItemExtension(CommonMenu.URL, typeof(CommonMenu));
UIObjectFactory.SetPackageItemExtension(MarqueeTag.URL, typeof(MarqueeTag));
UIObjectFactory.SetPackageItemExtension(BtnTextInputControl.URL, typeof(BtnTextInputControl));
UIObjectFactory.SetPackageItemExtension(CommonItemList.URL, typeof(CommonItemList));
UIObjectFactory.SetPackageItemExtension(BtnTitleInputControl.URL, typeof(BtnTitleInputControl));
UIObjectFactory.SetPackageItemExtension(NoticeItem.URL, typeof(NoticeItem));
UIObjectFactory.SetPackageItemExtension(CommonSubMenu.URL, typeof(CommonSubMenu));
UIObjectFactory.SetPackageItemExtension(BtnInputControl.URL, typeof(BtnInputControl));
UIObjectFactory.SetPackageItemExtension(ListTitleItem.URL, typeof(ListTitleItem));
UIObjectFactory.SetPackageItemExtension(ModelViewer.URL, typeof(ModelViewer));
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 1f891cc748e825346b263bab6ed92a69

View File

@@ -0,0 +1,14 @@
/**注册组件绑定关系。本脚本为自动生成每次生成会覆盖请勿手动修改生成插件文档及项目地址https://git.whoot.com/whoot-games/whoot.fguieditorplugin**/
using FairyGUI;
namespace NBF
{
public static class CommonNewBinder
{
[UIExtensionAutoBind]
public static void BindAll()
{
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: d63faf326c6305c419050dd92f09a3ba

View File

@@ -30,9 +30,9 @@ namespace NBF
{
await LoginHelper.Login(InputAccount.text);
BagPanel.Show();
// BagPanel.Show();
// BagSlotPanel.Show();
// FishingShopPanel.Show();
FishingShopPanel.Show();
Del();
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 92579122ea9d5304082e11a70b36b7e1

View File

@@ -0,0 +1,15 @@
// 本脚本只在不存在时会生成一次。组件逻辑写在当前脚本内。已存在不会再次生成覆盖
using UnityEngine;
using FairyGUI;
using NBC;
namespace NBF
{
public partial class ShopGearItem : GButton
{
private void OnInited()
{
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: d9f9ed6de5b3acd40916c6a8a0aa1b1b

View File

@@ -9,11 +9,6 @@ using UIPanel = NBC.UIPanel;
namespace NBF
{
public class ShopGearData
{
public string title;
}
public partial class FishingShopPanel : UIPanel
{
protected override void OnInit()
@@ -22,33 +17,33 @@ namespace NBF
this.AutoAddClick(OnClick);
IsShowCursor = true;
List<TabItemData> tabItemList = new List<TabItemData>();
for (int i = 0; i < 10; i++)
{
TabItemData tabItem = new TabItemData();
tabItem.Key = $"Tab_{i}";
for (int j = 0; j < 5; j++)
{
TabItemData tabSubItem = new TabItemData();
tabSubItem.Key = $"SubTab_{j}";
var count = Random.Range(2, 5);
for (int k = 0; k < count; k++)
{
var item = new ShopGearData
{
title = $"Item:{i}-{j}-{k}"
};
tabSubItem.Items.Add(item);
}
tabItem.Children.Add(tabSubItem);
}
tabItemList.Add(tabItem);
}
ItemList.SetPanel(this);
ItemList.SetData(tabItemList, true, true);
// List<TabItemData> tabItemList = new List<TabItemData>();
// for (int i = 0; i < 10; i++)
// {
// TabItemData tabItem = new TabItemData();
// tabItem.Key = $"Tab_{i}";
// for (int j = 0; j < 5; j++)
// {
// TabItemData tabSubItem = new TabItemData();
// tabSubItem.Key = $"SubTab_{j}";
// var count = Random.Range(2, 5);
// for (int k = 0; k < count; k++)
// {
// var item = new ShopGearData
// {
// title = $"Item:{i}-{j}-{k}"
// };
// tabSubItem.Items.Add(item);
// }
//
// tabItem.Children.Add(tabSubItem);
// }
//
// tabItemList.Add(tabItem);
// }
//
// ItemList.SetPanel(this);
// ItemList.SetData(tabItemList, true, true);
}
protected override void OnShow()
@@ -65,8 +60,8 @@ namespace NBF
private void OnClickItem(object item)
{
if (item is not ShopGearItem shopGearItem) return;
Log.Info($"click item ={shopGearItem.GearData.title}");
if (item is not ShopItem shopGearItem) return;
// Log.Info($"click item ={shopGearItem.GearData.title}");
}
private void OnClick(GComponent btn)

View File

@@ -0,0 +1,33 @@
/**本脚本为自动生成每次生成会覆盖请勿手动修改生成插件文档及项目地址https://git.whoot.com/whoot-games/whoot.fguieditorplugin**/
using FairyGUI;
using FairyGUI.Utils;
using NBC;
namespace NBF
{
public partial class ShopItem
{
public const string URL = "ui://hxr7rc7poome9";
public GImage back;
public GImage Quality;
public GTextField TextCoin;
public GLoader CoinIcon;
public GTextField TextCoin_2;
public override void ConstructFromXML(XML xml)
{
base.ConstructFromXML(xml);
back = (GImage)GetChild("back");
Quality = (GImage)GetChild("Quality");
TextCoin = (GTextField)GetChild("TextCoin");
CoinIcon = (GLoader)GetChild("CoinIcon");
TextCoin_2 = (GTextField)GetChild("TextCoin");
OnInited();
UILanguage.TrySetComponentLanguage(this);
}
}
}

View File

@@ -6,18 +6,18 @@ using NBC;
namespace NBF
{
public partial class ShopGearItem : ListItemBase
public partial class ShopItem : ListItemBase
{
public ShopGearData GearData;
// public ShopGearData GearData;
private void OnInited()
{
}
protected override void OnSetData(object showData)
{
GearData = showData as ShopGearData;
if(GearData == null) return;
title = GearData.title;
// GearData = showData as ShopGearData;
// if(GearData == null) return;
// title = GearData.title;
}
}
}