diff --git a/Assets/Resources/Fgui/Common/Common_atlas0.png b/Assets/Resources/Fgui/Common/Common_atlas0.png index f04ea13c5..309d29243 100644 Binary files a/Assets/Resources/Fgui/Common/Common_atlas0.png and b/Assets/Resources/Fgui/Common/Common_atlas0.png differ diff --git a/Assets/Resources/Fgui/Common/Common_fui.bytes b/Assets/Resources/Fgui/Common/Common_fui.bytes index b3599cc62..83524db00 100644 Binary files a/Assets/Resources/Fgui/Common/Common_fui.bytes and b/Assets/Resources/Fgui/Common/Common_fui.bytes differ diff --git a/Assets/Resources/Fgui/Fishing/Fishing_fui.bytes b/Assets/Resources/Fgui/Fishing/Fishing_fui.bytes index f24fcf4d1..5c00bf21c 100644 Binary files a/Assets/Resources/Fgui/Fishing/Fishing_fui.bytes and b/Assets/Resources/Fgui/Fishing/Fishing_fui.bytes differ diff --git a/Assets/Scripts/Fishing2/Data/Bag.meta b/Assets/Scripts/Fishing2/Data/Bag.meta new file mode 100644 index 000000000..9331e6e81 --- /dev/null +++ b/Assets/Scripts/Fishing2/Data/Bag.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 7924ca863f4b4ce8a7018a42852431a6 +timeCreated: 1756564816 \ No newline at end of file diff --git a/Assets/Scripts/Fishing2/Data/Bag/Bag.cs b/Assets/Scripts/Fishing2/Data/Bag/Bag.cs new file mode 100644 index 000000000..f7797f6fc --- /dev/null +++ b/Assets/Scripts/Fishing2/Data/Bag/Bag.cs @@ -0,0 +1,12 @@ +using NBC.Entitas; + +namespace NBF.Fishing2 +{ + /// + /// 背包 + /// + public class Bag : Entity + { + + } +} \ No newline at end of file diff --git a/Assets/Scripts/Fishing2/Data/Bag/Bag.cs.meta b/Assets/Scripts/Fishing2/Data/Bag/Bag.cs.meta new file mode 100644 index 000000000..c8cd35d4a --- /dev/null +++ b/Assets/Scripts/Fishing2/Data/Bag/Bag.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 2176086bd28445acb23a458c20d016ab +timeCreated: 1756564836 \ No newline at end of file diff --git a/Assets/Scripts/Fishing2/Data/Map/Scene/MapScene.cs b/Assets/Scripts/Fishing2/Data/Map/MapScene.cs similarity index 100% rename from Assets/Scripts/Fishing2/Data/Map/Scene/MapScene.cs rename to Assets/Scripts/Fishing2/Data/Map/MapScene.cs diff --git a/Assets/Scripts/Fishing2/Data/Map/Scene/MapScene.cs.meta b/Assets/Scripts/Fishing2/Data/Map/MapScene.cs.meta similarity index 100% rename from Assets/Scripts/Fishing2/Data/Map/Scene/MapScene.cs.meta rename to Assets/Scripts/Fishing2/Data/Map/MapScene.cs.meta diff --git a/Assets/Scripts/Fishing2/Data/Map/Scene.meta b/Assets/Scripts/Fishing2/Data/Map/Scene.meta deleted file mode 100644 index 8f939b12b..000000000 --- a/Assets/Scripts/Fishing2/Data/Map/Scene.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 2f5c6349983b45b0bc48d4f30ef677ee -timeCreated: 1756367958 \ No newline at end of file diff --git a/Assets/Scripts/Fishing2/Data/Role.meta b/Assets/Scripts/Fishing2/Data/Role.meta new file mode 100644 index 000000000..fa33c3ac6 --- /dev/null +++ b/Assets/Scripts/Fishing2/Data/Role.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: e38c5ef195074b4bb7b7faea5020eb96 +timeCreated: 1756565130 \ No newline at end of file diff --git a/Assets/Scripts/Fishing2/Data/Role/Role.cs b/Assets/Scripts/Fishing2/Data/Role/Role.cs new file mode 100644 index 000000000..30e67857d --- /dev/null +++ b/Assets/Scripts/Fishing2/Data/Role/Role.cs @@ -0,0 +1,32 @@ +using NBC; +using NBC.Entitas; +using NBC.Entitas.Interface; + +namespace NBF.Fishing2 +{ + public class Role : Entity + { + public long RoomId { get; set; } + public RoleInfo Info { get; set; } + } + + + public static class RoleSystem + { + public class RoleDestroySystem : DestroySystem + { + protected override void Destroy(Role self) + { + self.RoomId = 0; + self.Info = null; + } + } + + public static async FTask GetRoleInfo(this Role self) + { + var response = (Game2C_GetRoleInfoResponse)await Net.Call(new C2Game_GetRoleInfoRequest()); + self.RoomId = response.RoomId; + self.Info = response.RoleInfo; + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/Fishing2/Data/Role/Role.cs.meta b/Assets/Scripts/Fishing2/Data/Role/Role.cs.meta new file mode 100644 index 000000000..2eb31a7a6 --- /dev/null +++ b/Assets/Scripts/Fishing2/Data/Role/Role.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: e7bd45aa4474423cad46c65eeecc1a03 +timeCreated: 1756565134 \ No newline at end of file diff --git a/Assets/Scripts/Fishing2/Helper/MapHelper.cs b/Assets/Scripts/Fishing2/Helper/MapHelper.cs index d383d84f0..3c38250d7 100644 --- a/Assets/Scripts/Fishing2/Helper/MapHelper.cs +++ b/Assets/Scripts/Fishing2/Helper/MapHelper.cs @@ -19,7 +19,12 @@ namespace NBF.Fishing2 RoomId = roomId }); Log.Info($"进入地图请求返回={response.ErrorCode}"); - + //如果有房间 + if (roomId > 0) + { + //请求获取房间数据 + + } // 等待场景切换完成 await root.GetComponent().Wait(); Log.Info($"等待场景切换结束"); @@ -39,9 +44,11 @@ namespace NBF.Fishing2 { LoadingPanel.Show(); var sceneName = "Map99"; - //家族场景== + //加载场景== await SceneHelper.LoadScene(sceneName); + var map = App.Main.AddComponent(); + FishingPanel.Show(); // 通知等待场景切换的协程 diff --git a/Assets/Scripts/Fishing2/Data/Map/Scene/SceneHelper.cs b/Assets/Scripts/Fishing2/Helper/SceneHelper.cs similarity index 100% rename from Assets/Scripts/Fishing2/Data/Map/Scene/SceneHelper.cs rename to Assets/Scripts/Fishing2/Helper/SceneHelper.cs diff --git a/Assets/Scripts/Fishing2/Data/Map/Scene/SceneHelper.cs.meta b/Assets/Scripts/Fishing2/Helper/SceneHelper.cs.meta similarity index 100% rename from Assets/Scripts/Fishing2/Data/Map/Scene/SceneHelper.cs.meta rename to Assets/Scripts/Fishing2/Helper/SceneHelper.cs.meta diff --git a/Assets/Scripts/Fishing2/Helper/UnitHelper.cs b/Assets/Scripts/Fishing2/Helper/UnitHelper.cs index 01f937547..68397cb54 100644 --- a/Assets/Scripts/Fishing2/Helper/UnitHelper.cs +++ b/Assets/Scripts/Fishing2/Helper/UnitHelper.cs @@ -1,7 +1,10 @@ namespace NBF.Fishing2 { - public class UnitHelper + public static class UnitHelper { - + public static void InitUnit(this Unit self) + { + + } } } \ No newline at end of file diff --git a/Assets/Scripts/Init.cs b/Assets/Scripts/Init.cs index a12b87f87..831979b0a 100644 --- a/Assets/Scripts/Init.cs +++ b/Assets/Scripts/Init.cs @@ -130,16 +130,6 @@ namespace NBF LoadData(); CommonTopPanel.Show(); LoginPanel.Show(); - // FishingPanel.Show(); - // PreviewPanel.Show(); - - // Fishing.Inst.Go(1); - - // HomePanel.Show(); - // ChatTestPanel.Show(); - // SettingPanel.Show(); - // //测试登录 - // OnLoginButtonClick().Coroutine(); } private void LoadData() diff --git a/Assets/Scripts/Model/Login/LoginHelper.cs b/Assets/Scripts/Model/Login/LoginHelper.cs index b98b434e8..a08929c5f 100644 --- a/Assets/Scripts/Model/Login/LoginHelper.cs +++ b/Assets/Scripts/Model/Login/LoginHelper.cs @@ -3,6 +3,7 @@ using Assets.Scripts.Hotfix; using NBC; using NBC.Network; using NBF.Fishing2; +using Newtonsoft.Json; namespace NBF { @@ -12,9 +13,15 @@ namespace NBF public static async FTask Login(string account) { + var oldRole = App.Main.GetComponent(); + if (oldRole != null) + { + App.Main.RemoveComponent(); + } + _session = Net.CreateSession("127.0.0.1:20001"); - _session.Scene.AddComponent(); + // _session.Scene.AddComponent(); var acc = account; @@ -51,8 +58,19 @@ namespace NBF return; } + var role = App.Main.AddComponent(loginResponse.RoleId); Log.Debug($"登录到Gate服务器成功!ErrorCode:{loginResponse.ErrorCode}"); - await _session.Scene.EventComponent.PublishAsync(new ChangePosition()); + await role.GetRoleInfo(); + Log.Debug( + $"获取角色信息成功!roleId={role.Id} Room={role.RoomId} RoleInfo={JsonConvert.SerializeObject(role.Info)}"); + var mapId = role.Info.MapId; + if (mapId == 0) + { + Log.Warning("账号没有进入过地图,进入新手引导地图"); + mapId = 99; + } + + await MapHelper.EnterMap(mapId, role.RoomId); } } } \ No newline at end of file diff --git a/Assets/Scripts/OnSceneCreate_Init.cs b/Assets/Scripts/OnSceneCreate_Init.cs index 1aa5b0379..3d265f938 100644 --- a/Assets/Scripts/OnSceneCreate_Init.cs +++ b/Assets/Scripts/OnSceneCreate_Init.cs @@ -14,6 +14,8 @@ namespace NBF.Fishing2 scene.AddComponent(); scene.AddComponent(); } + + await FTask.CompletedTask; } } } \ No newline at end of file diff --git a/Assets/Scripts/UI/Binders/FishingBinder.cs b/Assets/Scripts/UI/Binders/FishingBinder.cs index 98f54c130..8b3241ff4 100644 --- a/Assets/Scripts/UI/Binders/FishingBinder.cs +++ b/Assets/Scripts/UI/Binders/FishingBinder.cs @@ -12,6 +12,8 @@ namespace NBF UIObjectFactory.SetPackageItemExtension(FishingStateInfo.URL, typeof(FishingStateInfo)); UIObjectFactory.SetPackageItemExtension(InteractiveTag.URL, typeof(InteractiveTag)); UIObjectFactory.SetPackageItemExtension(FishingPower.URL, typeof(FishingPower)); + UIObjectFactory.SetPackageItemExtension(FishingTeam.URL, typeof(FishingTeam)); + UIObjectFactory.SetPackageItemExtension(TeamItem.URL, typeof(TeamItem)); } } } \ No newline at end of file diff --git a/Assets/Scripts/UI/Fishing/FishingPanel.Designer.cs b/Assets/Scripts/UI/Fishing/FishingPanel.Designer.cs index ee972dd94..4621c0d56 100644 --- a/Assets/Scripts/UI/Fishing/FishingPanel.Designer.cs +++ b/Assets/Scripts/UI/Fishing/FishingPanel.Designer.cs @@ -32,6 +32,8 @@ namespace NBF public InteractiveTag Interactive; [AutoFind(Name = "OperationTips")] public GList OperationTips; + [AutoFind(Name = "Team")] + public FishingTeam Team; public override string[] GetDependPackages(){ return new string[] {"Common"}; } public static void Show(object param = null){ App.UI.OpenUI(param); } diff --git a/Assets/Scripts/UI/FishingTeam.Designer.cs b/Assets/Scripts/UI/FishingTeam.Designer.cs new file mode 100644 index 000000000..cd7ad2330 --- /dev/null +++ b/Assets/Scripts/UI/FishingTeam.Designer.cs @@ -0,0 +1,33 @@ +/**本脚本为自动生成,每次生成会覆盖!请勿手动修改,生成插件文档及项目地址:https://git.whoot.com/whoot-games/whoot.fguieditorplugin**/ + + +using FairyGUI; +using FairyGUI.Utils; +using NBC; + +namespace NBF +{ + public partial class FishingTeam + { + public const string URL = "ui://682kb9n0o9ci1u"; + + public CommonInput TeamInput; + public GButton BtnCreate; + public GButton BtnJoin; + public GButton BtnExit; + public GList List; + + public override void ConstructFromXML(XML xml) + { + base.ConstructFromXML(xml); + + TeamInput = (CommonInput)GetChild("TeamInput"); + BtnCreate = (GButton)GetChild("BtnCreate"); + BtnJoin = (GButton)GetChild("BtnJoin"); + BtnExit = (GButton)GetChild("BtnExit"); + List = (GList)GetChild("List"); + OnInited(); + UILanguage.TrySetComponentLanguage(this); + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/UI/FishingTeam.Designer.cs.meta b/Assets/Scripts/UI/FishingTeam.Designer.cs.meta new file mode 100644 index 000000000..1cebc1ff8 --- /dev/null +++ b/Assets/Scripts/UI/FishingTeam.Designer.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 7cc6ec326ea4bf54faf7e071cb31c12a \ No newline at end of file diff --git a/Assets/Scripts/UI/FishingTeam.cs b/Assets/Scripts/UI/FishingTeam.cs new file mode 100644 index 000000000..9fb01d529 --- /dev/null +++ b/Assets/Scripts/UI/FishingTeam.cs @@ -0,0 +1,15 @@ +// 本脚本只在不存在时会生成一次。组件逻辑写在当前脚本内。已存在不会再次生成覆盖 + +using UnityEngine; +using FairyGUI; +using NBC; + +namespace NBF +{ + public partial class FishingTeam : GComponent + { + private void OnInited() + { + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/UI/FishingTeam.cs.meta b/Assets/Scripts/UI/FishingTeam.cs.meta new file mode 100644 index 000000000..5dd06a07b --- /dev/null +++ b/Assets/Scripts/UI/FishingTeam.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 50df4e31a0175034284645c94c611056 \ No newline at end of file diff --git a/Assets/Scripts/UI/Login/LoginPanel.cs b/Assets/Scripts/UI/Login/LoginPanel.cs index 1c905c3cb..b6556e4b6 100644 --- a/Assets/Scripts/UI/Login/LoginPanel.cs +++ b/Assets/Scripts/UI/Login/LoginPanel.cs @@ -27,7 +27,7 @@ namespace NBF private async FTask OnLoginClick() { await LoginHelper.Login(InputAccount.text); - await MapHelper.EnterMap(99); + // await MapHelper.EnterMap(99); Del(); } } diff --git a/Assets/Scripts/UI/TeamItem.Designer.cs b/Assets/Scripts/UI/TeamItem.Designer.cs new file mode 100644 index 000000000..30aff52fb --- /dev/null +++ b/Assets/Scripts/UI/TeamItem.Designer.cs @@ -0,0 +1,27 @@ +/**本脚本为自动生成,每次生成会覆盖!请勿手动修改,生成插件文档及项目地址:https://git.whoot.com/whoot-games/whoot.fguieditorplugin**/ + + +using FairyGUI; +using FairyGUI.Utils; +using NBC; + +namespace NBF +{ + public partial class TeamItem + { + public const string URL = "ui://682kb9n0oso11t"; + + public GTextField title; + public GTextField TextScore; + + public override void ConstructFromXML(XML xml) + { + base.ConstructFromXML(xml); + + title = (GTextField)GetChild("title"); + TextScore = (GTextField)GetChild("TextScore"); + OnInited(); + UILanguage.TrySetComponentLanguage(this); + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/UI/TeamItem.Designer.cs.meta b/Assets/Scripts/UI/TeamItem.Designer.cs.meta new file mode 100644 index 000000000..8ec57a1bf --- /dev/null +++ b/Assets/Scripts/UI/TeamItem.Designer.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 5181414dcb090564cb84e5d71ff24841 \ No newline at end of file diff --git a/Assets/Scripts/UI/TeamItem.cs b/Assets/Scripts/UI/TeamItem.cs new file mode 100644 index 000000000..c955ca0cb --- /dev/null +++ b/Assets/Scripts/UI/TeamItem.cs @@ -0,0 +1,15 @@ +// 本脚本只在不存在时会生成一次。组件逻辑写在当前脚本内。已存在不会再次生成覆盖 + +using UnityEngine; +using FairyGUI; +using NBC; + +namespace NBF +{ + public partial class TeamItem : GComponent + { + private void OnInited() + { + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/UI/TeamItem.cs.meta b/Assets/Scripts/UI/TeamItem.cs.meta new file mode 100644 index 000000000..baf9d67c1 --- /dev/null +++ b/Assets/Scripts/UI/TeamItem.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: f0259ab9ca7292a4c976d275b5ce71bc \ No newline at end of file diff --git a/FGUIProject/assets/Common/Com/Head.xml b/FGUIProject/assets/Common/Com/Head.xml index a02003efc..8bc28c73f 100644 --- a/FGUIProject/assets/Common/Com/Head.xml +++ b/FGUIProject/assets/Common/Com/Head.xml @@ -4,7 +4,7 @@ - + diff --git a/FGUIProject/assets/Common/Com/UserHead.xml b/FGUIProject/assets/Common/Com/UserHead.xml new file mode 100644 index 000000000..8c68aad7d --- /dev/null +++ b/FGUIProject/assets/Common/Com/UserHead.xml @@ -0,0 +1,12 @@ + + + + + + + + + + +