进入地图相关内容

This commit is contained in:
2025-08-31 23:47:37 +08:00
parent b637e1723d
commit 1c0b272a6f
42 changed files with 242 additions and 64 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 MiB

After

Width:  |  Height:  |  Size: 1.5 MiB

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 7924ca863f4b4ce8a7018a42852431a6
timeCreated: 1756564816

View File

@@ -0,0 +1,12 @@
using NBC.Entitas;
namespace NBF.Fishing2
{
/// <summary>
/// 背包
/// </summary>
public class Bag : Entity
{
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 2176086bd28445acb23a458c20d016ab
timeCreated: 1756564836

View File

@@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: 2f5c6349983b45b0bc48d4f30ef677ee
timeCreated: 1756367958

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: e38c5ef195074b4bb7b7faea5020eb96
timeCreated: 1756565130

View File

@@ -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<Role>
{
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;
}
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: e7bd45aa4474423cad46c65eeecc1a03
timeCreated: 1756565134

View File

@@ -19,7 +19,12 @@ namespace NBF.Fishing2
RoomId = roomId
});
Log.Info($"进入地图请求返回={response.ErrorCode}");
//如果有房间
if (roomId > 0)
{
//请求获取房间数据
}
// 等待场景切换完成
await root.GetComponent<ObjectWait>().Wait<Wait_SceneChangeFinish>();
Log.Info($"等待场景切换结束");
@@ -39,9 +44,11 @@ namespace NBF.Fishing2
{
LoadingPanel.Show();
var sceneName = "Map99";
//家族场景==
//加载场景==
await SceneHelper.LoadScene(sceneName);
var map = App.Main.AddComponent<Map>();
FishingPanel.Show();
// 通知等待场景切换的协程

View File

@@ -1,7 +1,10 @@
namespace NBF.Fishing2
{
public class UnitHelper
public static class UnitHelper
{
public static void InitUnit(this Unit self)
{
}
}
}

View File

@@ -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()

View File

@@ -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<Role>();
if (oldRole != null)
{
App.Main.RemoveComponent<Role>();
}
_session = Net.CreateSession("127.0.0.1:20001");
_session.Scene.AddComponent<UnitUnityComponent>();
// _session.Scene.AddComponent<UnitUnityComponent>();
var acc = account;
@@ -51,8 +58,19 @@ namespace NBF
return;
}
var role = App.Main.AddComponent<Role>(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);
}
}
}

View File

@@ -14,6 +14,8 @@ namespace NBF.Fishing2
scene.AddComponent<ObjectWait>();
scene.AddComponent<MapManageComponent>();
}
await FTask.CompletedTask;
}
}
}

View File

@@ -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));
}
}
}

View File

@@ -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<FishingPanel>(param); }

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 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);
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 7cc6ec326ea4bf54faf7e071cb31c12a

View File

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

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 50df4e31a0175034284645c94c611056

View File

@@ -27,7 +27,7 @@ namespace NBF
private async FTask OnLoginClick()
{
await LoginHelper.Login(InputAccount.text);
await MapHelper.EnterMap(99);
// await MapHelper.EnterMap(99);
Del();
}
}

27
Assets/Scripts/UI/TeamItem.Designer.cs generated Normal file
View File

@@ -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);
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 5181414dcb090564cb84e5d71ff24841

View File

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

View File

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

View File

@@ -4,7 +4,7 @@
<graph id="n3_fcfg" name="n3" xy="0,0" size="30,30" type="eclipse">
<relation target="" sidePair="width-width,height-height"/>
</graph>
<loader id="n2_fcfg" name="icon" xy="0,0" size="30,30" url="ui://6hgkvlaufcfgfs" fill="scale">
<loader id="n2_fcfg" name="icon" xy="0,0" size="30,30" url="ui://6hgkvlaufcfgfs" align="center" vAlign="middle" fill="scale">
<relation target="" sidePair="width-width,height-height"/>
</loader>
</displayList>

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<component size="90,90" extention="Button">
<displayList>
<component id="n0_fcfg" name="icon" src="fcfgft" fileName="Com/Head.xml" xy="0,0" size="90,90">
<relation target="" sidePair="width-width,height-height"/>
</component>
<loader id="n1_fcfg" name="flag" xy="7,74" size="19,13" url="ui://6hgkvlaufcfgfr" fill="scaleMatchHeight">
<relation target="" sidePair="width-width%,height-height%,left-left%,bottom-bottom%"/>
</loader>
</displayList>
<Button/>
</component>

View File

@@ -1,8 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<component size="90,90" extention="Button">
<displayList>
<component id="n0_fcfg" name="icon" src="fcfgft" fileName="Com/Head.xml" xy="0,0" size="90,90"/>
<loader id="n1_fcfg" name="flag" xy="7,74" size="19,13" url="ui://6hgkvlaufcfgfr" fill="scaleMatchHeight"/>
</displayList>
<Button/>
</component>

View File

@@ -73,7 +73,7 @@
<image id="fcfgfr" name="CHN.png" path="/Icon/国旗/" exported="true"/>
<image id="fcfgfs" name="b_cfc46a5198bacf1db9fd46f56f712572.jpg" path="/"/>
<component id="fcfgft" name="Head.xml" path="/Com/" exported="true"/>
<component id="fcfgfu" name="UserTopHead.xml" path="/Com/" exported="true"/>
<component id="fcfgfu" name="UserHead.xml" path="/Com/" exported="true"/>
<image id="fcfgfz" name="icon_common_25.png" path="/Images/" exported="true"/>
<image id="fcfgg0" name="icon_common_26.png" path="/Images/" exported="true"/>
<image id="fcfgg1" name="icon_common_27.png" path="/Images/" exported="true"/>

View File

@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<component size="303,496">
<displayList>
<component id="n36_o9ci" name="TeamInput" src="9zboma" fileName="Com/Inputs/CommonInput.xml" pkg="6hgkvlau" xy="9,2" size="283,35"/>
<component id="n37_o9ci" name="BtnCreate" src="9zbomb" fileName="Com/Buttons/BtnCommon.xml" pkg="6hgkvlau" xy="7,50" size="80,35">
<Button title="创建"/>
</component>
<component id="n38_o9ci" name="BtnJoin" src="9zbomb" fileName="Com/Buttons/BtnCommon.xml" pkg="6hgkvlau" xy="112,50" size="80,35">
<Button title="加入"/>
</component>
<component id="n39_o9ci" name="BtnExit" src="9zbomb" fileName="Com/Buttons/BtnCommon.xml" pkg="6hgkvlau" xy="211,50" size="80,35">
<Button title="退出"/>
</component>
<list id="n40_o9ci" name="List" xy="9,96" size="285,393" overflow="scroll" lineGap="4" defaultItem="ui://682kb9n0oso11t" autoClearItems="true">
<item/>
<item/>
<item/>
<item/>
<item/>
<item/>
<item/>
</list>
</displayList>
</component>

View File

@@ -37,7 +37,7 @@
<item title="拖钓的方式"/>
<item title="下锚"/>
</list>
<component id="n35_oso1" name="n35" src="oso11r" fileName="FishingTeam.xml" xy="1652,444">
<component id="n36_o9ci" name="Team" src="o9ci1u" fileName="Com/FishingTeam.xml" xy="1606,308">
<relation target="" sidePair="middle-middle,right-right"/>
</component>
</displayList>

View File

@@ -1,28 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<component size="299,311">
<controller name="page" pages="0,未加入,1,已加入" selected="0"/>
<displayList>
<image id="n35_oso1" name="n35" src="o0hzfa" fileName="Images/Shapes/Square/Square.png" pkg="6hgkvlau" xy="0,1" size="299,310" alpha="0.3" color="#5c748b">
<relation target="" sidePair="width-width,height-height"/>
</image>
<image id="n34_oso1" name="n34" src="o0hzfc" fileName="Images/Shapes/Square/Square - Stroke 4px.png" pkg="6hgkvlau" xy="0,0" size="299,310" color="#5c748b">
<relation target="" sidePair="width-width,height-height"/>
</image>
<component id="n36_oso1" name="BtnJoin" src="9zbomb" fileName="Com/Buttons/BtnCommon.xml" pkg="6hgkvlau" xy="89,266">
<relation target="" sidePair="center-center,bottom-bottom"/>
</component>
<list id="n37_oso1" name="List" xy="7,56" size="286,200" overflow="scroll" lineGap="4" defaultItem="ui://682kb9n0oso11t" autoClearItems="true">
<item/>
<item/>
<item/>
<item/>
<item/>
<item/>
<item/>
</list>
<text id="n38_oso1" name="n38" xy="98,9" size="102,32" fontSize="22" color="#d8fbff" text="ABCDEFG">
<relation target="" sidePair="center-center,top-top"/>
</text>
<component id="n41_oso1" name="BtnClose" src="fcfggb" fileName="Com/Buttons/BtnClose.xml" pkg="6hgkvlau" xy="265,9"/>
</displayList>
</component>

View File

@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<component size="245,32">
<component size="373,60">
<displayList>
<loader id="n40_oso1" name="Flag" xy="0,5" size="26,24" url="ui://bo7mod5eoso159" align="center" vAlign="middle" fill="scaleMatchWidth"/>
<text id="n39_oso1" name="title" xy="29,0" size="155,32" fontSize="22" color="#d8fbff" text="老八秘制小汉堡"/>
<text id="n41_oso1" name="TextScore" xy="217,1" pivot="1,1" size="27,29" fontSize="20" color="#d8fbff" align="right" text="99">
<text id="n39_oso1" name="title" xy="61,14" size="155,32" fontSize="22" color="#d0d0d0" text="老八秘制小汉堡"/>
<text id="n41_oso1" name="TextScore" xy="345,15" pivot="1,1" size="27,29" fontSize="20" color="#d8fbff" align="right" text="99">
<relation target="" sidePair="middle-middle,right-right"/>
</text>
<component id="n43_o9ci" name="n43" src="fcfgfu" fileName="Com/UserHead.xml" pkg="6hgkvlau" xy="6,4" size="49,50" aspect="true"/>
</displayList>
</component>

View File

@@ -16,8 +16,8 @@
<component id="o0hz1n" name="FishingPower.xml" path="/Com/"/>
<component id="fcfg1o" name="FishingStateInfo.xml" path="/Com/"/>
<component id="fcfg1p" name="InteractiveTag.xml" path="/Com/" exported="true"/>
<component id="oso11r" name="FishingTeam.xml" path="/"/>
<component id="oso11t" name="TeamItem.xml" path="/" exported="true"/>
<component id="o9ci1u" name="FishingTeam.xml" path="/Com/"/>
</resources>
<publish name="" path="../Assets/Resources/Fgui/Fishing" packageCount="2" genCode="true"/>
</packageDescription>

View File

@@ -5,6 +5,7 @@
"fontAdjustment": false,
"colorScheme": [
"白色字 #FFFFFF",
"白灰字 #d0d0d0",
"常规色 #D8FBFF",
"选中色 #8BF3FF",
"选中色叠加灰 #8BCCD1",

View File

@@ -0,0 +1 @@
{"url":"ui://682kb9n0o9ci1u","name":"FishingTeam","scriptType":"component","isCustomName":false,"customName":"","annotation":"","member":{}}

View File

@@ -14,6 +14,7 @@
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AKeyCode_002Ecs_002Fl_003AC_0021_003FUsers_003F60527_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F021f30a9a92b48ce98ae6b39956dd76a1df600_003Fd1_003F01a95d3a_003FKeyCode_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AList_00601_002Ecs_002Fl_003AC_0021_003FUsers_003Fbob_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F314938d17f3848e8ac683e11b27f62ee46ae00_003Fe8_003F01e5a04a_003FList_00601_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AMathf_002Ecs_002Fl_003AC_0021_003FUsers_003F60527_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F021f30a9a92b48ce98ae6b39956dd76a1df600_003Fdd_003F448b7101_003FMathf_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AObject_002Ecs_002Fl_003AC_0021_003FUsers_003F60527_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F3789ee403a53437cbb6b5d9ab6311f51573620_003F28_003Fb85198b6_003FObject_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AObject_002Ecs_002Fl_003AC_0021_003FUsers_003Fbob_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F021f30a9a92b48ce98ae6b39956dd76a1df600_003F35_003F4c34802c_003FObject_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AObject_002Ecs_002Fl_003AC_0021_003FUsers_003Fbob_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F314938d17f3848e8ac683e11b27f62ee46ae00_003F0d_003F47ff7f51_003FObject_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003APhysics_002Ecs_002Fl_003AC_0021_003FUsers_003F60527_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F03ef825315384b1cab81c4b53eb03d922ac00_003Fc6_003F12ad2f00_003FPhysics_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>