Merge pull request 'Transmit Service' (#391) from feature/transmit-services into develop

Reviewed-on: https://git.pthub.vn/Unity/perfect-world-unity/pulls/391
This commit is contained in:
anhld
2026-04-30 10:48:59 +00:00
24 changed files with 683 additions and 66 deletions
+1 -1
View File
@@ -9,7 +9,7 @@
{
"name": "Attach to Unity",
"type": "vstuc",
"request": "attach"
"request": "attach",
}
]
}
@@ -131,13 +131,13 @@ Material:
m_Colors:
- _BaseColor: {r: 0, g: 1, b: 0.9534545, a: 0.8509804}
- _Color: {r: 0, g: 0.5, b: 1, a: 0.8}
- _DeepColor: {r: 0, g: 0.9803924, b: 1, a: 0.78431374}
- _DeepColor: {r: 0, g: 0.9803924, b: 1, a: 0.29803923}
- _FoamColor: {r: 1, g: 1, b: 1, a: 1}
- _FoamSpeed: {r: 0.1, g: 0.1, b: 0, a: 0}
- _FoamSpeedA: {r: 0.1, g: 0.1, b: 0, a: 0}
- _FoamSpeedB: {r: -0.08, g: 0.06, b: 0, a: 0}
- _NormalTiling: {r: 40, g: 40, b: 0, a: 0}
- _ShallowColor: {r: 0, g: 0.9806142, b: 1, a: 1}
- _ShallowColor: {r: 0, g: 0.9806141, b: 1, a: 0.68235296}
- _WaterColor: {r: 0.19999996, g: 0.6, b: 0.8, a: 0.8}
- _WaveDirection: {r: 1, g: 1, b: 0, a: 0}
- _WaveSpeed1: {r: 0.05, g: 0.03, b: 0, a: 0}
@@ -0,0 +1,51 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f04e4cee6b3592d46866e3d631e4d4e0, type: 3}
m_Name: WorldTargetSO
m_EditorClassIdentifier:
worldTargets:
- id: 9047
name:
Name: "\u4E5D\u5195\u5C18\u5BF0\u53F0"
world_id: 161
vecPos:
x: -799.016
y: 45
z: -282.283
domain_id: -1
- id: 9048
name:
Name: "\u841D\u4F1A\u57CE"
world_id: 161
vecPos:
x: -162.798
y: 36
z: 299.386
domain_id: -1
- id: 9049
name:
Name: "\u5D06\u5CD2\u53E4\u9547"
world_id: 161
vecPos:
x: 876.326
y: 51
z: 369.481
domain_id: -1
- id: 9050
name:
Name: "\u6A2A\u5929\u9619"
world_id: 161
vecPos:
x: 887.151
y: 154
z: -295.974
domain_id: -1
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 3e25bab2c9ca9714ea2d7d5f094ddd5b
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 33958689dea439040976b900bc6494d5
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,11 @@
using System.Collections.Generic;
using UnityEngine;
namespace BrewMonster.Scripts.Common.DataProcess.ScriptableObjects
{
[CreateAssetMenu(fileName = "WorldTargetSO", menuName = "BrewMonster/WorldTargetSO")]
public class WorldTargetSO : ScriptableObject
{
public List<TRANS_TARGET> worldTargets;
}
}
@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: f04e4cee6b3592d46866e3d631e4d4e0
@@ -1,8 +1,36 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Runtime.InteropServices;
using BrewMonster;
using BrewMonster.Scripts.Common.DataProcess.ScriptableObjects;
using CSNetwork.GPDataType;
using UnityEngine;
[System.Serializable]
public struct TRANS_TARGET
{
public int id;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
public ushort[] name;
public string Name;
public int world_id;
public A3DVECTOR3 vecPos;
public int domain_id;
}
[System.Serializable]
public struct TRANS_TARGET_SERV
{
public int id;
public int world_id;
public A3DVECTOR3 vecPos;
public int domain_id;
}
[System.Serializable]
public struct GShopBuyOption
{
@@ -71,4 +99,43 @@ public static class BinaryReaderExtensions
byte[] bytes = reader.ReadBytes(length * 2); // Wide chars are 2 bytes each
return System.Text.Encoding.Unicode.GetString(bytes).TrimEnd('\0');
}
}
public class GlobalDataManager
{
public static void globaldata_load()
{
// read world target data
var worldTargetSO = Resources.Load<WorldTargetSO>("WorldTargetSO");
if(worldTargetSO == null)
{
BMLogger.LogError("GlobalDataManager: world target data not found");
#if UNITY_EDITOR
// show a dialouge for the error
UnityEditor.EditorUtility.DisplayDialog("GlobalDataManager", "World target data not found", "OK");
#endif
return;
}
GlobalTransmitData.global_trans_targets = worldTargetSO.worldTargets;
//TODO: Load the domain info file. It's a binary file.
// now load domain info file
// AFileImage domainFile = new AFileImage();
// if( !domainFile.Open("Data\\domain.data", AFILE_OPENEXIST | AFILE_BINARY) )
// {
// a_LogOutput(1, "GlobalData_Load(), Failed to open domain data file");
// return false;
// }
}
}
public class GlobalTransmitData
{
public static List<TRANS_TARGET> global_trans_targets = new();
private static List<TRANS_TARGET_SERV> global_trans_targets_server = new();
public static List<TRANS_TARGET> globaldata_gettranstargets => global_trans_targets;
}
@@ -138,6 +138,8 @@ namespace BrewMonster.Network
// 加载 coord_data.txtC++Configs/Coord_data.txt)用于任务可点击链接的自动移动。
LoadObjectCoord();
LoadPetAutoSkill();
GlobalDataManager.globaldata_load();
return true;
}
public static CECConfigs GetConfigs() { return m_pConfigs; }
@@ -104,7 +104,7 @@ namespace BrewMonster.Scripts.Managers
public async Task<GameObject> GetModelPlayer(byte profession, byte gender)
{
var prefab = await AddressableManager.Instance.LoadPrefabAsync(_playerModelPaths[profession * GENDER.NUM_GENDER + gender]);
// BMLogger.LogError("_playerModelPaths[profession * GENDER.NUM_GENDER + gender] = " + _playerModelPaths[profession * GENDER.NUM_GENDER + gender]);
BMLogger.LogError("_playerModelPaths[profession * GENDER.NUM_GENDER + gender] = " + _playerModelPaths[profession * GENDER.NUM_GENDER + gender]);
if (prefab == null)
{
BMLogger.LogError( $" [NPC Manager] Not found Prefab from Addressable with profession : {profession} gender : {gender}");
@@ -1018,6 +1018,7 @@ namespace CSNetwork.GPDataType
}
[StructLayout(LayoutKind.Sequential, Pack = 1)]
[System.Serializable]
public struct A3DVECTOR3
{
public float x;
@@ -2303,6 +2304,60 @@ namespace CSNetwork.GPDataType
{
public ushort waypoint;
};
public struct cmd_waypoint_list
{
public uint count;
public ushort[] list;
public bool FromBytes(byte[] data)
{
const int CountSize = sizeof(uint);
const int ItemSize = sizeof(ushort);
if (data == null || data.Length < CountSize)
{
count = 0;
list = Array.Empty<ushort>();
return false;
}
ReadOnlySpan<byte> buffer = data;
uint parsedCount = BinaryPrimitives.ReadUInt32LittleEndian(buffer.Slice(0, CountSize));
uint maxCount = (uint)((data.Length - CountSize) / ItemSize);
if (parsedCount > maxCount || parsedCount > int.MaxValue)
{
count = 0;
list = Array.Empty<ushort>();
return false;
}
int itemCount = (int)parsedCount;
if (itemCount == 0)
{
count = parsedCount;
list = Array.Empty<ushort>();
return true;
}
ushort[] parsedList = list;
if (parsedList == null || parsedList.Length != itemCount)
parsedList = new ushort[itemCount];
int offset = CountSize;
for (int i = 0; i < itemCount; i++)
{
parsedList[i] = BinaryPrimitives.ReadUInt16LittleEndian(buffer.Slice(offset, ItemSize));
offset += ItemSize;
}
count = parsedCount;
list = parsedList;
return true;
}
}
[StructLayout(LayoutKind.Sequential, Pack = 1)]
public static class GNETRoles
{
@@ -32,6 +32,7 @@ namespace BrewMonster.Scripts
/// </summary>
public async void ShowAllPlayerModels(List<RoleInfo> roleInfos)
{
BMLogger.Log($"ShowAllPlayerModels: {roleInfos.Count}");
_loadVersion++;
int version = _loadVersion;
@@ -111,12 +112,14 @@ namespace BrewMonster.Scripts
private async UniTask<GameObject> LoadPlayerModel(RoleInfo role)
{
BMLogger.Log($"LoadPlayerModel: {role.roleid}");
var elemendataman = BrewMonster.ElementDataManProvider.GetElementDataMan();
GameObject prefab = await NPCManager.Instance.GetModelPlayer(role.occupation, role.gender);
if (prefab == null)
{
return null;
}
BMLogger.Log($"LoadPlayerModel: {role.roleid} - prefab loaded");
GameObject model = Instantiate(prefab);
var playerDefaultEquipments = model.GetComponentInChildren<PlayerDefaultEquipments>();
if (playerDefaultEquipments == null)
@@ -3240,11 +3240,12 @@ namespace BrewMonster.UI
// id_dialog = (int)pService.id_dialog;
// idFunction = (int)SERVICE_TYPE.NPC_HEAL;
// }
// else if (DataType == DATA_TYPE.DT_NPC_TRANSMIT_SERVICE)
// {
// NPC_TRANSMIT_SERVICE pService = (NPC_TRANSMIT_SERVICE)pData;
// idFunction = (int)SERVICE_TYPE.NPC_TRANSMIT;
// }
else if (DataType == DATA_TYPE.DT_NPC_TRANSMIT_SERVICE)
{
NPC_TRANSMIT_SERVICE pService = (NPC_TRANSMIT_SERVICE)pData;
id_dialog = (int)pService.id_dialog;
idFunction = (int)SERVICE_TYPE.NPC_TRANSMIT;
}
// else if (DataType == DATA_TYPE.DT_NPC_TRANSPORT_SERVICE)
// {
// NPC_TRANSPORT_SERVICE pService = (NPC_TRANSPORT_SERVICE)pData;
@@ -3464,8 +3465,10 @@ namespace BrewMonster.UI
}
else if (idFunction == (int)SERVICE_TYPE.NPC_TRANSMIT)
{
dialogue1 = "Win_WorldMapTravel";
// pShow1 = m_pAUIManager.GetDialog("Win_WorldMapTravel");
dialogue1 = "Win_WorldMap";
var pShow1 = m_pAUIManager.GetDialog("Win_WorldMap") as DlgWorldMap;
pShow1.Show(true);
pShow1.BuildTravelMap((uint)DATA_TYPE.DT_NPC_TRANSMIT_SERVICE, pData);
//((CDlgWorldMap*)pShow1).BuildTravelMap(DT_NPC_TRANSMIT_SERVICE, pData);
}
// else if (idFunction == (int)SERVICE_TYPE.NPC_SKILL)
@@ -37,6 +37,14 @@ namespace BrewMonster.UI
public CDlgMiniMap m_pDlgMiniMap;
//TODO: There're some managers here. We probably need to implement them in the future.
// CECCustomizeMgr *m_CustomizeMgr;
// CECHomeDlgsMgr *m_HomeDlgsMgr;
// CECMiniBarMgr *m_pMiniBarMgr;
private CECMapDlgsMgr m_pMapDlgsMgr;
// CECShortcutMgr *m_pShortcutMgr;
// CECIconStateMgr *m_pIconStateMgr;
private readonly ChatEmotionDisplayPipeline _chatEmotionPipeline = new ChatEmotionDisplayPipeline();
/// <summary>
@@ -437,7 +445,15 @@ namespace BrewMonster.UI
m_IconMap[(byte)EC_GAMEUI_ICONS.ICONS_INVENTORY] = (INVENTORY_ICONLIST_NAME, Resources.LoadAll<Sprite>(INVENTORY_ICONLIST_NAME));
m_IconMap[(byte)EC_GAMEUI_ICONS.ICONS_STATE] = (STATE_ICONLIST_NAME, Resources.LoadAll<Sprite>(STATE_ICONLIST_NAME));
m_IconMap[(byte)EC_GAMEUI_ICONS.ICONS_SKILLGRP] = (SKILL_GROUP_ICON_NAME, Resources.LoadAll<Sprite>(SKILL_GROUP_ICON_NAME));
m_pMapDlgsMgr = new CECMapDlgsMgr();
}
public CECMapDlgsMgr GetMapDlgsMgr()
{
return m_pMapDlgsMgr;
}
public AUIImagePictureBase SetCover(AUIImagePictureBase pImgPic, string nameImage, EC_GAMEUI_ICONS iCONS_TYPE)
{
if (pImgPic == null)
@@ -1,5 +1,8 @@
using System.Collections.Generic;
using BrewMonster.Network;
using CSNetwork.Common;
using CSNetwork.GPDataType;
using ModelRenderer.Scripts.Common;
using UnityEngine;
using UnityEngine.UI;
@@ -9,9 +12,21 @@ namespace BrewMonster.UI
{
[SerializeField] private Image mapImage;
[SerializeField] private Image _hostPlayerPositionImage;
[Space(10)]
[SerializeField] private float _positionFactor = 2f;
[SerializeField] private Button _closeButton;
[Space(10)]
[Header("Transmit Points")]
[SerializeField] private RectTransform _transPointButtonParent;
// this is the prefab for the trans point button
[SerializeField] private WorldMapTransPoint _transPointButtonPrefab;
private Dictionary<int, WorldMapTransPoint> _transPoints = new();
// 世界 / World
const int MAJOR_MAP = 1;
@@ -53,6 +68,17 @@ namespace BrewMonster.UI
}
}
public override void CloseDialogue()
{
base.CloseDialogue();
// hide all the trans points
foreach(var transPoint in _transPoints)
{
transPoint.Value.gameObject.SetActive(false);
}
}
public override bool Render()
{
UpdateHostPlayerPositionImage();
@@ -63,7 +89,7 @@ namespace BrewMonster.UI
Vector3 _hostPlayerPosition;
Quaternion _hostPlayerRotation;
private void UpdateHostPlayerPositionImage()
private void UpdateHostPlayerPositionImage()
{
if (_hostPlayerPositionImage == null)
{
@@ -92,6 +118,35 @@ namespace BrewMonster.UI
hostPlayerRectTransform.localRotation = Quaternion.Euler(0, 0, -_hostPlayerRotation.eulerAngles.y);
}
/// <summary>
/// If use use Transmit Scroll or Transmit Service, we have to show the transmit points on the map.
/// </summary>
private void ShowTranPoints()
{
CECGameUIMan pGameUI = CECUIManager.Instance.GetInGameUIMan();
var transPoints = pGameUI.GetMapDlgsMgr().m_transPoints;
WorldMapTransPoint transPointObject = null;
int currentMapId = (int)GetDataPtr("WorldID");
foreach(var transPointPair in transPoints)
{
// check if the trans point is already created. If not, create it.
if(_transPoints.TryGetValue(transPointPair.Key, out transPointObject))
{
// now enable the trans point object
transPointObject.gameObject.SetActive(true);
}
else
{
// create the trans point object
transPointObject = Instantiate(_transPointButtonPrefab, _transPointButtonParent);
transPointObject.Init(this, transPointPair.Key);
transPointObject.GetComponent<RectTransform>().anchoredPosition = new Vector2(transPointPair.Value.vecPos.x / _positionFactor, transPointPair.Value.vecPos.z / _positionFactor);
_transPoints[transPointPair.Key] = transPointObject;
transPointObject.gameObject.SetActive(true);
}
}
}
private bool TryGetHostPlayerPosition(out Vector3 hostPlayerPosition, out Quaternion hostPlayerRotation)
{
hostPlayerPosition = Vector3.zero;
@@ -127,12 +182,14 @@ namespace BrewMonster.UI
if(dwType == (uint)DATA_TYPE.DT_NPC_TRANSMIT_SERVICE)
{
// worldid = pMgr->FindTransmitWorldID((NPC_TRANSMIT_SERVICE*)pData);
var serviceData = (NPC_TRANSMIT_SERVICE)pData;
var worldInstanceName = UnityGameSession.Instance.GetWorldInstanceName((int)serviceData.id);
// save the worldid
// SetDataPtr((void*)worldid, "WorldID");
SetDataPtr(worldid, "WorldID");
// pMgr->LoadMapTexture(m_pA3DDevice, pImage, CECMapDlgsMgr::MAP_TYPE_TRANSMIT);
ShowTranPoints();
}
else if(dwType == (uint)DATA_TYPE.DT_TRANSMITSCROLL_ESSENCE)
{
@@ -162,9 +219,100 @@ namespace BrewMonster.UI
OnCloseButtonClicked();
}
public void OnTransPointClicked(int id)
{
var transPoints = CECUIManager.Instance.GetInGameUIMan().GetMapDlgsMgr().m_transPoints;
if(transPoints.TryGetValue(id, out var transPoint))
{
UnityGameSession.c2s_CmdGoto(transPoint.vecPos.x, transPoint.vecPos.y, transPoint.vecPos.z);
// close the map
OnCloseButtonClicked();
}
}
private void OnCloseButtonClicked()
{
CloseDialogue();
}
}
public struct TRANS_POINT
{
public int id;
public int worldid;
public string strName;
public A3DVECTOR3 vecPos;
};
public enum TransMode
{
TM_INVALID = 0,
TM_TRANSMITSCROLL = 1, // 通过传送卷轴传送 / Transmit scroll
TM_NPC_TRANSMIT_NORMAL = 2, // 通过 NPC 传送服务、向当前 NPC 连接点传送 / Transmit service to the current NPC connection point
TM_NPC_TRANSMIT_DIRECT = 3, // 通过 NPC 传送服务、向当前 NPC 可达点直接传送 / Transmit service to the current NPC reachable point directly
};
public class CECMapDlgsMgr
{
public int m_nCurFlagIndex;
public bool m_bMarking;
public bool m_bMapDragging;
public List<TRANS_POINT> m_vecTeamMate = new();
public Dictionary<int, TRANS_POINT> m_transPoints = new();
// update player way-points
public void UpdateWayPoints(ushort[] pData, uint iSize, bool bClear)
{
var vecTarget = GlobalTransmitData.globaldata_gettranstargets;
if(bClear)
{
m_transPoints.Clear();
}
// got valid points.
for(int i = 0; i < iSize; i++ )
{
int idThis = pData[i];//*(pData+i);
for(int j = 0; j < vecTarget.Count; j++ )
{
if( idThis != vecTarget[j].id ) continue;
TRANS_POINT tp;
tp.id = idThis;
tp.strName = vecTarget[j].Name;
tp.vecPos = vecTarget[j].vecPos;
tp.worldid = vecTarget[j].world_id;
m_transPoints[idThis] = tp;
break;
}
}
}
}
public class TransWay
{
public const int WAYPOINT_ME = 0;
public const int WAYPOINT_TARGET = 1;
public const int MINIMAP_UL = 0;
public const int MINIMAP_UR = 1;
public const int MINIMAP_LL = 2;
public const int MINIMAP_LR = 3;
public const int MINIMAP_MAX = 4;
// The transmission mode to use when sending the transmission protocol (TM_NPC_TRANSMIT_NORMAL =2 and the number of wayPoints is greater than 1 may be true at the same time)
public TransMode mode; // 发送传送协议时应使用的传送模式(TM_NPC_TRANSMIT_NORMAL =2 与 wayPoints 个数大于1可能同时成立)
public int nCost; // 需要的完美币 / The required perfect coin
public int nLevel; // 需求的等级 / The required level
// The transmission route (excluding the start point and including the end point) (can be used for display in all modes, can only be used for protocol in TM_NPC_TRANSMIT_DIRECT mode)
public List<TRANS_POINT> wayPoints = new(); // 传送路线(不含起点、包括终点)(各模式下均可用于显示,TM_NPC_TRANSMIT_DIRECT 模式下才可用于协议)
}
}
@@ -12,6 +12,10 @@ namespace BrewMonster.UI
public DlgWorldMap dlgWorldMap;
// if true, user can click on the map to move the host player to the clicked position.
// ideally we only enble this for testing/development.
[SerializeField] private bool _enableClickToMove = true;
// The host player player (0,0,0) is not at the center of the map. It usually has an offset that we have to calculate at Awake
private Vector2 _hostPlayerOffsetPosition;
@@ -38,6 +42,8 @@ namespace BrewMonster.UI
// This triggers automatically when the user clicks/taps on this Image
public void OnPointerClick(PointerEventData eventData)
{
if(!_enableClickToMove) return;
Vector2 localCursorPosition;
// Convert the screen click position to local anchored position inside the Map
@@ -0,0 +1,26 @@
using UnityEngine;
namespace BrewMonster.UI
{
/// <summary>
/// This script should be attached to the trans point button in the world map.
/// A Transmit Point will show up when user use Transmit Scroll or Transmit Service. (Dịch vụ dịch chuyển ở NPC)
/// </summary>
public class WorldMapTransPoint : MonoBehaviour
{
[HideInInspector] public int id;
private DlgWorldMap _dlgWorldMap;
public void Init(DlgWorldMap dlgWorldMap, int id)
{
_dlgWorldMap = dlgWorldMap;
this.id = id;
}
public void OnClick()
{
_dlgWorldMap.OnTransPointClicked(id);
}
}
}
@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 252f6fb85c7e72d49b2e8ea20c2d59c8
@@ -6,7 +6,7 @@ TextureImporter:
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 1
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
@@ -37,13 +37,13 @@ TextureImporter:
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapU: 1
wrapV: 1
wrapW: 0
nPOTScale: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
@@ -52,9 +52,9 @@ TextureImporter:
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 0
textureType: 8
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
@@ -139,7 +139,7 @@ TextureImporter:
customData:
physicsShape: []
bones: []
spriteID:
spriteID: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:
+8
View File
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 34c21eadb8c5ac749a341f92da503988
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -75,6 +75,153 @@ MonoBehaviour:
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!1 &222794976166085183
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 8205908652006291613}
- component: {fileID: 701947802954970172}
- component: {fileID: 4401574036847015979}
- component: {fileID: 6841128026403163401}
- component: {fileID: 2537562987844392478}
m_Layer: 0
m_Name: TransmitPoint
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
--- !u!224 &8205908652006291613
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 222794976166085183}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 6891421740142056974}
m_Father: {fileID: 7169122999130120872}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.518}
m_AnchorMax: {x: 0.5, y: 0.518}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 12, y: 12.000002}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &701947802954970172
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 222794976166085183}
m_CullTransparentMesh: 1
--- !u!114 &4401574036847015979
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 222794976166085183}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 21300000, guid: bd0c1ffed4c1947fe817f36f72257283, type: 3}
m_Type: 0
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!114 &6841128026403163401
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 222794976166085183}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Navigation:
m_Mode: 3
m_WrapAround: 0
m_SelectOnUp: {fileID: 0}
m_SelectOnDown: {fileID: 0}
m_SelectOnLeft: {fileID: 0}
m_SelectOnRight: {fileID: 0}
m_Transition: 0
m_Colors:
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
m_ColorMultiplier: 1
m_FadeDuration: 0.1
m_SpriteState:
m_HighlightedSprite: {fileID: 0}
m_PressedSprite: {fileID: 0}
m_SelectedSprite: {fileID: 0}
m_DisabledSprite: {fileID: 0}
m_AnimationTriggers:
m_NormalTrigger: Normal
m_HighlightedTrigger: Highlighted
m_PressedTrigger: Pressed
m_SelectedTrigger: Selected
m_DisabledTrigger: Disabled
m_Interactable: 1
m_TargetGraphic: {fileID: 4401574036847015979}
m_OnClick:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 2537562987844392478}
m_TargetAssemblyTypeName: BrewMonster.UI.WorldMapTransPoint, Assembly-CSharp
m_MethodName: OnClick
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
--- !u!114 &2537562987844392478
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 222794976166085183}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 252f6fb85c7e72d49b2e8ea20c2d59c8, type: 3}
m_Name:
m_EditorClassIdentifier:
id: 0
--- !u!1 &936441858863998774
GameObject:
m_ObjectHideFlags: 0
@@ -232,6 +379,81 @@ RectTransform:
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!1 &3185449669602415166
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 6891421740142056974}
- component: {fileID: 4819673339622355777}
- component: {fileID: 603420354022532661}
m_Layer: 0
m_Name: hitbox
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &6891421740142056974
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3185449669602415166}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 8205908652006291613}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 50, y: 50}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &4819673339622355777
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3185449669602415166}
m_CullTransparentMesh: 1
--- !u!114 &603420354022532661
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3185449669602415166}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 0.003921569}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 0}
m_Type: 0
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!1 &4370684628053341786
GameObject:
m_ObjectHideFlags: 0
@@ -363,6 +585,8 @@ MonoBehaviour:
_hostPlayerPositionImage: {fileID: 4036230907032538800}
_positionFactor: 1.8
_closeButton: {fileID: 8858186809287203567}
_transPointButtonParent: {fileID: 7169122999130120872}
_transPointButtonPrefab: {fileID: 2537562987844392478}
--- !u!1 &8308536083041954008
GameObject:
m_ObjectHideFlags: 0
@@ -547,6 +771,7 @@ RectTransform:
- {fileID: 5906545349664091413}
- {fileID: 1510574663178069641}
- {fileID: 9142400375056319150}
- {fileID: 8205908652006291613}
m_Father: {fileID: 7323734624486819451}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
@@ -606,3 +831,4 @@ MonoBehaviour:
m_EditorClassIdentifier:
_hostPlayerPositionImage: {fileID: 5906545349664091413}
dlgWorldMap: {fileID: 135853640611757204}
_enableClickToMove: 1
+18 -44
View File
@@ -1,5 +1,6 @@
using BrewMonster.Network;
using BrewMonster.Scripts;
using BrewMonster.UI;
using CSNetwork;
using CSNetwork.GPDataType;
using Cysharp.Threading.Tasks;
@@ -57,54 +58,27 @@ namespace BrewMonster
void OnMsgHstWayPoint(ECMSG Msg)
{
//CECGameUIMan pGameUI = EC_Game.GetGameRun().GetUIManager().GetInGameUIMan();
CECGameUIMan pGameUI = CECUIManager.Instance.GetInGameUIMan();
//if (Convert.ToInt32(Msg.dwParam2) == CommandID.ACTIVATE_WAYPOINT)
//{
// cmd_activate_waypoint pCmd = GPDataTypeHelper.FromBytes<cmd_activate_waypoint>((byte[])Msg.dwParam1);
// m_aWayPoints.Add(pCmd.waypoint);
if (Convert.ToInt32(Msg.dwParam2) == CommandID.ACTIVATE_WAYPOINT)
{
cmd_activate_waypoint pCmd = GPDataTypeHelper.FromBytes<cmd_activate_waypoint>((byte[])Msg.dwParam1);
m_aWayPoints.Add(pCmd.waypoint);
// // add to waypoints array
// pGameUI.GetMapDlgsMgr().UpdateWayPoints(&pCmd.waypoint, 1, false);
// add to waypoints array
// pGameUI.GetMapDlgsMgr().UpdateWayPoints(&pCmd.waypoint, 1, false);
}
else if (Convert.ToInt32(Msg.dwParam2) == CommandID.WAYPOINT_LIST)
{
cmd_waypoint_list pCmd = new cmd_waypoint_list();
pCmd.FromBytes((byte[])Msg.dwParam1);
// // Print a notify message
// const CECMapDlgsMgr::PointMap& aWayPoints = pGameUI.GetMapDlgsMgr().GetTransPoint();
// CECMapDlgsMgr::PointMap::const_iterator itr = aWayPoints.find(pCmd.waypoint);
// if(itr != aWayPoints.end())
// {
// g_pGame.GetGameRun().AddFixedMessage(FIXMSG_NEWWAYPOINT, (itr.second).strName);
for (int i=0; i < pCmd.count; i++)
m_aWayPoints.Add(pCmd.list[i]);
// bool bCanPopUITips = true;
// int count = CECUIConfig::Instance().GetGameUI().GetTaskIDDisableWayPointsUITipsCount();
// // ¼ì²éÉíÉÏÊÇ·ñÓнûÖ¹µ¯³ötipsµÄÈÎÎñ
// for (int i=0;i<count;i++){
// int taskID = CECUIConfig::Instance().GetGameUI().GetTaskIDDisableWayPointsUITips(i);
// if(GetTaskInterface() && GetTaskInterface().HasTask(taskID)){
// bCanPopUITips = false;
// break;
// }
// }
// // µ¯³ötips
// CECScriptMan* pScriptMan = g_pGame.GetGameRun().GetUIManager().GetScriptMan();
// if (pScriptMan && bCanPopUITips)
// {
// pScriptMan.GetContext().GetUI().SetTipDialogTitleAndContent(AC2AS_CP(CP_UTF8, pGameUI.GetStringFromTable(11350)), AC2AS_CP(CP_UTF8, (itr.second).strName));
// pScriptMan.GetContext().GetUI().ShowTip(500, 500, 5000, 300);
// }
// }
// }
// else if (Msg.dwParam2 == WAYPOINT_LIST)
// {
// cmd_waypoint_list* pCmd = (cmd_waypoint_list*)Msg.dwParam1;
// m_aWayPoints.SetSize(pCmd.count, 16);
// for (size_t i = 0; i < pCmd.count; i++)
// m_aWayPoints[i] = pCmd.list[i];
// // update the whole list
// pGameUI.GetMapDlgsMgr().UpdateWayPoints(pCmd.list, pCmd.count, true);
// }
// update the whole list
pGameUI.GetMapDlgsMgr().UpdateWayPoints(pCmd.list, pCmd.count, true);
}
}
private void OnMsgHstPressCancel(ECMSG Msg)
+1
View File
@@ -49,6 +49,7 @@ public class CECUIManager : MonoSingleton<CECUIManager>
Sprite[] m_iconlistIvtr;
private CDlgInfoTooltip m_pDlgSkillTooltip;
// Task update timer / 任务更新计时器
private float _nextTaskUpdateTime = 0f;
private const float TASK_UPDATE_INTERVAL = .1f;