移动和旋转
This commit is contained in:
@@ -812,7 +812,7 @@ MonoBehaviour:
|
|||||||
videoPlayer: {fileID: 1810378423}
|
videoPlayer: {fileID: 1810378423}
|
||||||
startCanvas: {fileID: 386239068}
|
startCanvas: {fileID: 386239068}
|
||||||
playVideo: 0
|
playVideo: 0
|
||||||
controllerType: 1
|
controllerType: 0
|
||||||
--- !u!81 &2487858301405542861
|
--- !u!81 &2487858301405542861
|
||||||
AudioListener:
|
AudioListener:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|||||||
@@ -48,6 +48,9 @@ namespace NBF
|
|||||||
public const string Run = "Run";
|
public const string Run = "Run";
|
||||||
public const string Use1 = "Use1";
|
public const string Use1 = "Use1";
|
||||||
public const string Use2 = "Use2";
|
public const string Use2 = "Use2";
|
||||||
|
|
||||||
|
public const string Move = "Move";
|
||||||
|
public const string Look = "Look";
|
||||||
}
|
}
|
||||||
|
|
||||||
#region Load Icon
|
#region Load Icon
|
||||||
|
|||||||
@@ -1,10 +1,17 @@
|
|||||||
using System;
|
using System;
|
||||||
using NBC.Entitas;
|
using NBC.Entitas;
|
||||||
using NBC.Entitas.Interface;
|
using NBC.Entitas.Interface;
|
||||||
|
using UnityEngine;
|
||||||
using UnityEngine.InputSystem;
|
using UnityEngine.InputSystem;
|
||||||
|
|
||||||
namespace NBF.Fishing2
|
namespace NBF.Fishing2
|
||||||
{
|
{
|
||||||
|
public enum ControllerType
|
||||||
|
{
|
||||||
|
KeyboardMouse = 0,
|
||||||
|
GamePad = 1
|
||||||
|
}
|
||||||
|
|
||||||
public class InputComponent : Entity
|
public class InputComponent : Entity
|
||||||
{
|
{
|
||||||
public PlayerInputControl PlayerInputControl { get; set; }
|
public PlayerInputControl PlayerInputControl { get; set; }
|
||||||
@@ -29,6 +36,21 @@ namespace NBF.Fishing2
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public event Action<string> OnPlayerCanceled;
|
public event Action<string> OnPlayerCanceled;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 执行输入事件
|
||||||
|
/// </summary>
|
||||||
|
public event Action<InputAction.CallbackContext> OnPlayerValuePerformed;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 执行输入事件完毕
|
||||||
|
/// </summary>
|
||||||
|
public event Action<InputAction.CallbackContext> OnPlayerValueCanceled;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 触发交互游戏对象
|
||||||
|
/// </summary>
|
||||||
|
public event Action<InteractiveObject> OnInteractiveObjectAction;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 手柄输入
|
/// 手柄输入
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -39,51 +61,9 @@ namespace NBF.Fishing2
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public static bool IsUIStopInput;
|
public static bool IsUIStopInput;
|
||||||
|
|
||||||
public void OnUIButtonPerformed(InputAction.CallbackContext context)
|
|
||||||
{
|
|
||||||
OnUIPerformed?.Invoke(context.action.name);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnUIButtonCanceled(InputAction.CallbackContext context)
|
#region Event
|
||||||
{
|
|
||||||
OnUICanceled?.Invoke(context.action.name);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnPlayerButtonPerformed(InputAction.CallbackContext context)
|
|
||||||
{
|
|
||||||
if (IsUIStopInput) return;
|
|
||||||
var actionName = context.action.name;
|
|
||||||
// if (actionName == "Op1")
|
|
||||||
// {
|
|
||||||
// OnOp1Action?.Invoke(true);
|
|
||||||
// }
|
|
||||||
// else if (actionName == "Op2")
|
|
||||||
// {
|
|
||||||
// OnOp2Action?.Invoke(true);
|
|
||||||
// }
|
|
||||||
|
|
||||||
OnPlayerPerformed?.Invoke(actionName);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnPlayerButtonCanceled(InputAction.CallbackContext context)
|
|
||||||
{
|
|
||||||
if (IsUIStopInput) return;
|
|
||||||
var actionName = context.action.name;
|
|
||||||
// if (actionName == "Op1")
|
|
||||||
// {
|
|
||||||
// OnOp1Action?.Invoke(false);
|
|
||||||
// }
|
|
||||||
// else if (actionName == "Op2")
|
|
||||||
// {
|
|
||||||
// OnOp2Action?.Invoke(false);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
OnPlayerCanceled?.Invoke(actionName);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class InputComponentSystem
|
|
||||||
{
|
|
||||||
public class InputComponentAwakeSystem : AwakeSystem<InputComponent>
|
public class InputComponentAwakeSystem : AwakeSystem<InputComponent>
|
||||||
{
|
{
|
||||||
protected override void Awake(InputComponent self)
|
protected override void Awake(InputComponent self)
|
||||||
@@ -114,6 +94,11 @@ namespace NBF.Fishing2
|
|||||||
action.performed += self.OnPlayerButtonPerformed;
|
action.performed += self.OnPlayerButtonPerformed;
|
||||||
action.canceled += self.OnPlayerButtonCanceled;
|
action.canceled += self.OnPlayerButtonCanceled;
|
||||||
}
|
}
|
||||||
|
else if (action.type == InputActionType.Value)
|
||||||
|
{
|
||||||
|
action.performed += self.OnInputPlayerValuePerformed;
|
||||||
|
action.canceled += self.OnInputPlayerValueCanceled;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -147,10 +132,91 @@ namespace NBF.Fishing2
|
|||||||
action.performed -= self.OnPlayerButtonPerformed;
|
action.performed -= self.OnPlayerButtonPerformed;
|
||||||
action.canceled -= self.OnPlayerButtonCanceled;
|
action.canceled -= self.OnPlayerButtonCanceled;
|
||||||
}
|
}
|
||||||
|
else if (action.type == InputActionType.Value)
|
||||||
|
{
|
||||||
|
action.performed -= self.OnInputPlayerValuePerformed;
|
||||||
|
action.canceled -= self.OnInputPlayerValueCanceled;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void OnUIButtonPerformed(InputAction.CallbackContext context)
|
||||||
|
{
|
||||||
|
OnUIPerformed?.Invoke(context.action.name);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnUIButtonCanceled(InputAction.CallbackContext context)
|
||||||
|
{
|
||||||
|
OnUICanceled?.Invoke(context.action.name);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnPlayerButtonPerformed(InputAction.CallbackContext context)
|
||||||
|
{
|
||||||
|
if (IsUIStopInput) return;
|
||||||
|
var actionName = context.action.name;
|
||||||
|
// if (actionName == "Op1")
|
||||||
|
// {
|
||||||
|
// OnOp1Action?.Invoke(true);
|
||||||
|
// }
|
||||||
|
// else if (actionName == "Op2")
|
||||||
|
// {
|
||||||
|
// OnOp2Action?.Invoke(true);
|
||||||
|
// }
|
||||||
|
|
||||||
|
OnPlayerPerformed?.Invoke(actionName);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnPlayerButtonCanceled(InputAction.CallbackContext context)
|
||||||
|
{
|
||||||
|
if (IsUIStopInput) return;
|
||||||
|
var actionName = context.action.name;
|
||||||
|
// if (actionName == "Op1")
|
||||||
|
// {
|
||||||
|
// OnOp1Action?.Invoke(false);
|
||||||
|
// }
|
||||||
|
// else if (actionName == "Op2")
|
||||||
|
// {
|
||||||
|
// OnOp2Action?.Invoke(false);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
OnPlayerCanceled?.Invoke(actionName);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnInputPlayerValuePerformed(InputAction.CallbackContext context)
|
||||||
|
{
|
||||||
|
if (IsUIStopInput) return;
|
||||||
|
OnPlayerValuePerformed?.Invoke(context);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnInputPlayerValueCanceled(InputAction.CallbackContext context)
|
||||||
|
{
|
||||||
|
if (IsUIStopInput) return;
|
||||||
|
OnPlayerValueCanceled?.Invoke(context);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
public Vector2 GetMovementInput()
|
||||||
|
{
|
||||||
|
if (IsUIStopInput) return Vector2.zero;
|
||||||
|
return PlayerInputControl.Player.Move?.ReadValue<Vector2>() ?? Vector2.zero;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Vector2 GetLookInput()
|
||||||
|
{
|
||||||
|
if (IsUIStopInput) return Vector2.zero;
|
||||||
|
return PlayerInputControl.Player.Look?.ReadValue<Vector2>() ?? Vector2.zero;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SendUIInput(string actionName)
|
||||||
|
{
|
||||||
|
OnUIPerformed?.Invoke(actionName);
|
||||||
|
OnUICanceled?.Invoke(actionName);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -13,21 +13,25 @@ namespace NBF.Fishing2
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 开始进入地图
|
/// 开始进入地图
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static async FTask<int> EnterMap(int mapId, long roomId = 0)
|
public static async FTask<int> EnterMap(int mapId, string roomCode = "")
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var root = App.Main;
|
var root = App.Main;
|
||||||
|
|
||||||
|
|
||||||
var response = (Map2C_EnterMapResponse)await Net.Call(new C2Map_EnterMapRequest()
|
var response = (Map2C_EnterMapResponse)await Net.Call(new C2Map_EnterMapRequest()
|
||||||
{
|
{
|
||||||
MapId = mapId,
|
MapId = mapId,
|
||||||
RoomId = roomId
|
RoomId = roomCode
|
||||||
});
|
});
|
||||||
Log.Info($"进入地图请求返回={response.ErrorCode}");
|
Log.Info($"进入地图请求返回={response.ErrorCode}");
|
||||||
//如果有房间
|
//如果有房间
|
||||||
if (roomId > 0)
|
if (!string.IsNullOrEmpty(roomCode))
|
||||||
{
|
{
|
||||||
//加入房间并请求获取房间数据
|
//加入房间并请求获取房间数据
|
||||||
|
await RoomHelper.EnterRoom(roomCode);
|
||||||
|
// mapId = roomMapId;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 等待场景切换完成
|
// 等待场景切换完成
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using NBC;
|
using NBC;
|
||||||
|
using Unity.Mathematics;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
namespace NBF.Fishing2
|
namespace NBF.Fishing2
|
||||||
{
|
{
|
||||||
@@ -10,7 +12,6 @@ namespace NBF.Fishing2
|
|||||||
MapUnitInfo mapUnit = new MapUnitInfo();
|
MapUnitInfo mapUnit = new MapUnitInfo();
|
||||||
mapUnit.Id = self.RoleId;
|
mapUnit.Id = self.RoleId;
|
||||||
mapUnit.RoleInfo = self.ToSimpleInfo();
|
mapUnit.RoleInfo = self.ToSimpleInfo();
|
||||||
mapUnit.Location = new MapUnitPositionInfo();
|
|
||||||
mapUnit.Gears = self.Gears.First();
|
mapUnit.Gears = self.Gears.First();
|
||||||
mapUnit.FishingInfo = new UnitFishingInfo();
|
mapUnit.FishingInfo = new UnitFishingInfo();
|
||||||
return mapUnit;
|
return mapUnit;
|
||||||
@@ -30,5 +31,53 @@ namespace NBF.Fishing2
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#region Vector
|
||||||
|
|
||||||
|
public static Vector3Info ToVector3Info(this Vector3 self)
|
||||||
|
{
|
||||||
|
var ret = new Vector3Info();
|
||||||
|
ret.x = self.x;
|
||||||
|
ret.y = self.y;
|
||||||
|
ret.z = self.z;
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static QuaternionInfo ToQuaternionInfo(this Quaternion self)
|
||||||
|
{
|
||||||
|
var ret = new QuaternionInfo();
|
||||||
|
ret.x = self.x;
|
||||||
|
ret.y = self.y;
|
||||||
|
ret.z = self.z;
|
||||||
|
ret.w = self.w;
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static Vector3 ToVector3(this Vector3Info self)
|
||||||
|
{
|
||||||
|
var ret = new Vector3
|
||||||
|
{
|
||||||
|
x = self.x,
|
||||||
|
y = self.y,
|
||||||
|
z = self.z
|
||||||
|
};
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static Quaternion ToQuaternion(this QuaternionInfo self)
|
||||||
|
{
|
||||||
|
var ret = new Quaternion
|
||||||
|
{
|
||||||
|
x = self.x,
|
||||||
|
y = self.y,
|
||||||
|
z = self.z,
|
||||||
|
w = self.w
|
||||||
|
};
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
22
Assets/Scripts/Fishing2/Helper/RoomHelper.cs
Normal file
22
Assets/Scripts/Fishing2/Helper/RoomHelper.cs
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
using NBC;
|
||||||
|
|
||||||
|
namespace NBF.Fishing2
|
||||||
|
{
|
||||||
|
public class RoomHelper
|
||||||
|
{
|
||||||
|
public static async FTask EnterRoom(string roomCode)
|
||||||
|
{
|
||||||
|
var response = (G2C_EnterRoomResponse)await Net.Call(new C2G_EnterRoomRequest()
|
||||||
|
{
|
||||||
|
RoomCode = roomCode
|
||||||
|
});
|
||||||
|
Log.Info($"进入房间返回 Code={response.RoomCode} 房间玩家数量={response.Units.Count}");
|
||||||
|
// if (response.ErrorCode != 0)
|
||||||
|
// {
|
||||||
|
// return 0;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// return response.MapId;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
3
Assets/Scripts/Fishing2/Helper/RoomHelper.cs.meta
Normal file
3
Assets/Scripts/Fishing2/Helper/RoomHelper.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 0a565f17a34541a096ae34b8e67344d9
|
||||||
|
timeCreated: 1757244384
|
||||||
@@ -10,5 +10,15 @@ namespace NBF.Fishing2
|
|||||||
await FTask.CompletedTask;
|
await FTask.CompletedTask;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static bool IsSelf(this MapUnit self)
|
||||||
|
{
|
||||||
|
if (self.Id == Game.SelfId)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
3
Assets/Scripts/Fishing2/Map/Handler.meta
Normal file
3
Assets/Scripts/Fishing2/Map/Handler.meta
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 9720afaa3bc94081b63a7c0571e4c86a
|
||||||
|
timeCreated: 1757251153
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
using NBC;
|
||||||
|
using NBC.Network;
|
||||||
|
using NBC.Network.Interface;
|
||||||
|
|
||||||
|
namespace Fishing2.Map
|
||||||
|
{
|
||||||
|
public class Map2C_RoleEnterMapNotifyHandler : Message<Map2C_RoleEnterRoomNotify>
|
||||||
|
{
|
||||||
|
protected override async FTask Run(Session session, Map2C_RoleEnterRoomNotify message)
|
||||||
|
{
|
||||||
|
Log.Info($"收到进入房间推送 id={message.Info.Id} ");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: b0934eeab5b8445b824f1337f774379e
|
||||||
|
timeCreated: 1757251141
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
using NBC;
|
||||||
|
using NBC.Network;
|
||||||
|
using NBC.Network.Interface;
|
||||||
|
|
||||||
|
namespace Fishing2.Map.Handler
|
||||||
|
{
|
||||||
|
public class Map2C_RoleExitMapNotifyHandler : Message<Map2C_RoleExitRoomNotify>
|
||||||
|
{
|
||||||
|
protected override async FTask Run(Session session, Map2C_RoleExitRoomNotify message)
|
||||||
|
{
|
||||||
|
Log.Info($"收到离开房间推送 id={message.Id} ");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 18ae467167c44db1873fee88067d2f9a
|
||||||
|
timeCreated: 1757251193
|
||||||
@@ -36,7 +36,7 @@ namespace NBF.Fishing2
|
|||||||
|
|
||||||
public void CreteMapUnit(MapUnitInfo unitInfo)
|
public void CreteMapUnit(MapUnitInfo unitInfo)
|
||||||
{
|
{
|
||||||
var mapUnit = Entity.Create<MapUnit>(Scene, unitInfo.RoleInfo.RoleId, true, true);
|
var mapUnit = Entity.Create<MapUnit>(Scene, unitInfo.Id, true, true);
|
||||||
mapUnit.SetUnitInfo(unitInfo);
|
mapUnit.SetUnitInfo(unitInfo);
|
||||||
Add(mapUnit);
|
Add(mapUnit);
|
||||||
}
|
}
|
||||||
|
|||||||
30
Assets/Scripts/Fishing2/Move/Map2C_LookNotifyHandler.cs
Normal file
30
Assets/Scripts/Fishing2/Move/Map2C_LookNotifyHandler.cs
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
using NBC;
|
||||||
|
using NBC.Network;
|
||||||
|
using NBC.Network.Interface;
|
||||||
|
|
||||||
|
namespace NBF.Fishing2
|
||||||
|
{
|
||||||
|
public class Map2C_LookNotifyHandler : Message<Map2C_LookeNotify>
|
||||||
|
{
|
||||||
|
protected override async FTask Run(Session session, Map2C_LookeNotify message)
|
||||||
|
{
|
||||||
|
Log.Info($"收到朝向推送 id={message.Id} ");
|
||||||
|
var map = App.Main.GetComponent<Map>();
|
||||||
|
var unit = map.Units[message.Id];
|
||||||
|
if (unit.IsSelf())
|
||||||
|
{
|
||||||
|
Log.Info("自己的旋转消息,不处理");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var moveComponent = unit.GetComponent<CharacterControllerComponent>();
|
||||||
|
if (moveComponent != null)
|
||||||
|
{
|
||||||
|
moveComponent.OnServerLook(message.Rotation.ToVector3(), message.Timestamp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
await FTask.CompletedTask;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: f1f00b074c7f48248773361036d3bfcf
|
||||||
|
timeCreated: 1757238435
|
||||||
33
Assets/Scripts/Fishing2/Move/Map2C_MoveNotifyHandler.cs
Normal file
33
Assets/Scripts/Fishing2/Move/Map2C_MoveNotifyHandler.cs
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
using NBC;
|
||||||
|
using NBC.Network;
|
||||||
|
using NBC.Network.Interface;
|
||||||
|
|
||||||
|
namespace NBF.Fishing2
|
||||||
|
{
|
||||||
|
public class Map2C_MoveNotifyHandler : Message<Map2C_MoveNotify>
|
||||||
|
{
|
||||||
|
protected override async FTask Run(Session session, Map2C_MoveNotify message)
|
||||||
|
{
|
||||||
|
Log.Info($"收到移动推送 id={message.Id} stop={message.IsStop}");
|
||||||
|
// session.Scene
|
||||||
|
// session.Scene.GetComponent<MapUnitInfo>(message.Id),
|
||||||
|
var map = App.Main.GetComponent<Map>();
|
||||||
|
var unit = map.Units[message.Id];
|
||||||
|
var moveComponent = unit.GetComponent<CharacterControllerComponent>();
|
||||||
|
if (moveComponent != null)
|
||||||
|
{
|
||||||
|
if (message.IsStop)
|
||||||
|
{
|
||||||
|
moveComponent.OnServerStopMove(message.Position.ToVector3(), message.Timestamp);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
moveComponent.OnServerStartMove(message.Position.ToVector3(),
|
||||||
|
message.Direction.ToVector3(), 3, message.Timestamp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
await FTask.CompletedTask;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 2306a332c3f842e78fd8d70c9ef1f8ed
|
||||||
|
timeCreated: 1757148423
|
||||||
@@ -1,339 +1,41 @@
|
|||||||
using System;
|
using System.Collections.Generic;
|
||||||
using System.Collections.Generic;
|
|
||||||
using NBC;
|
using NBC;
|
||||||
using NBC.Entitas;
|
using NBC.Entitas;
|
||||||
using NBC.Entitas.Interface;
|
using NBC.Entitas.Interface;
|
||||||
using NBC.Helper;
|
using UnityEngine;
|
||||||
using Unity.Mathematics;
|
using UnityEngine.InputSystem;
|
||||||
|
|
||||||
namespace NBF.Fishing2
|
namespace NBF.Fishing2
|
||||||
{
|
{
|
||||||
public class MoveComponent : Entity
|
[System.Serializable]
|
||||||
|
public struct MoveState
|
||||||
{
|
{
|
||||||
public float3 PreTarget
|
public Vector3 startPosition; // 开始移动时的位置
|
||||||
{
|
public Vector3 moveDirection; // 移动方向(标准化向量)
|
||||||
get { return this.Targets[this.N - 1]; }
|
public float moveSpeed; // 移动速度
|
||||||
}
|
public bool isMoving; // 是否正在移动
|
||||||
|
public double serverTimestamp; // 服务器时间戳
|
||||||
public float3 NextTarget
|
|
||||||
{
|
|
||||||
get { return this.Targets[this.N]; }
|
|
||||||
}
|
|
||||||
|
|
||||||
// 开启移动协程的时间
|
|
||||||
public long BeginTime;
|
|
||||||
|
|
||||||
// 每个点的开始时间
|
|
||||||
public long StartTime { get; set; }
|
|
||||||
|
|
||||||
// 开启移动协程的Unit的位置
|
|
||||||
public float3 StartPos;
|
|
||||||
|
|
||||||
public float3 RealPos
|
|
||||||
{
|
|
||||||
get { return this.Targets[0]; }
|
|
||||||
}
|
|
||||||
|
|
||||||
private long needTime;
|
|
||||||
|
|
||||||
public long NeedTime
|
|
||||||
{
|
|
||||||
get { return this.needTime; }
|
|
||||||
set { this.needTime = value; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public long MoveTimer;
|
|
||||||
|
|
||||||
public float Speed; // m/s
|
|
||||||
|
|
||||||
public FTask<bool> tcs;
|
|
||||||
|
|
||||||
public List<float3> Targets = new List<float3>();
|
|
||||||
|
|
||||||
public float3 FinalTarget
|
|
||||||
{
|
|
||||||
get { return this.Targets[^1]; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public int N;
|
|
||||||
public int TurnTime;
|
|
||||||
public bool IsTurnHorizontal;
|
|
||||||
|
|
||||||
public quaternion From;
|
|
||||||
public quaternion To;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class MoveComponentSystem
|
public class MoveComponent : Entity
|
||||||
{
|
{
|
||||||
|
public bool Run;
|
||||||
|
|
||||||
|
public readonly Queue<MoveState> MoveStateQueue = new Queue<MoveState>();
|
||||||
|
|
||||||
|
#region System
|
||||||
|
|
||||||
public class MoveComponentDestroySystem : DestroySystem<MoveComponent>
|
public class MoveComponentDestroySystem : DestroySystem<MoveComponent>
|
||||||
{
|
{
|
||||||
protected override void Destroy(MoveComponent self)
|
protected override void Destroy(MoveComponent self)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
self.Run = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static bool IsArrived(this MoveComponent self)
|
#endregion
|
||||||
{
|
|
||||||
return self.Targets.Count == 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static bool ChangeSpeed(this MoveComponent self, float speed)
|
|
||||||
{
|
|
||||||
if (self.IsArrived())
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (speed < 0.0001)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
MapUnit unit = self.GetParent<MapUnit>();
|
|
||||||
List<float3> path = new List<float3>();
|
|
||||||
|
|
||||||
self.MoveForward(false);
|
|
||||||
path.Add(unit.Position); // 第一个是Unit的pos
|
|
||||||
for (int i = self.N; i < self.Targets.Count; ++i)
|
|
||||||
{
|
|
||||||
path.Add(self.Targets[i]);
|
|
||||||
}
|
|
||||||
|
|
||||||
self.MoveToAsync(path, speed).Coroutine();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 该方法不需要用cancelToken的方式取消,因为即使不传入cancelToken,多次调用该方法也要取消之前的移动协程,上层可以stop取消
|
|
||||||
public static async FTask<bool> MoveToAsync(this MoveComponent self, List<float3> target, float speed,
|
|
||||||
int turnTime = 100)
|
|
||||||
{
|
|
||||||
self.Stop(false);
|
|
||||||
foreach (float3 v in target)
|
|
||||||
{
|
|
||||||
self.Targets.Add(v);
|
|
||||||
}
|
|
||||||
|
|
||||||
self.IsTurnHorizontal = true;
|
|
||||||
self.TurnTime = turnTime;
|
|
||||||
self.Speed = speed;
|
|
||||||
self.tcs = FTask<bool>.Create(true);
|
|
||||||
|
|
||||||
self.Scene.EventComponent.Publish(new MoveStart() { Unit = self.GetParent<MapUnit>() });
|
|
||||||
|
|
||||||
self.StartMove();
|
|
||||||
|
|
||||||
bool moveRet = await self.tcs;
|
|
||||||
|
|
||||||
if (moveRet)
|
|
||||||
{
|
|
||||||
self.Scene.EventComponent.Publish(new MoveStop() { Unit = self.GetParent<MapUnit>() });
|
|
||||||
}
|
|
||||||
|
|
||||||
return moveRet;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ret: 停止的时候,移动协程的返回值
|
|
||||||
private static void MoveForward(this MoveComponent self, bool ret)
|
|
||||||
{
|
|
||||||
MapUnit unit = self.GetParent<MapUnit>();
|
|
||||||
|
|
||||||
long timeNow = TimeHelper.Now;
|
|
||||||
long moveTime = timeNow - self.StartTime;
|
|
||||||
|
|
||||||
while (true)
|
|
||||||
{
|
|
||||||
if (moveTime <= 0)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 计算位置插值
|
|
||||||
if (moveTime >= self.NeedTime)
|
|
||||||
{
|
|
||||||
unit.Position = self.NextTarget;
|
|
||||||
if (self.TurnTime > 0)
|
|
||||||
{
|
|
||||||
unit.Rotation = self.To;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// 计算位置插值
|
|
||||||
float amount = moveTime * 1f / self.NeedTime;
|
|
||||||
if (amount > 0)
|
|
||||||
{
|
|
||||||
float3 newPos = math.lerp(self.StartPos, self.NextTarget, amount);
|
|
||||||
unit.Position = newPos;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 计算方向插值
|
|
||||||
if (self.TurnTime > 0)
|
|
||||||
{
|
|
||||||
amount = moveTime * 1f / self.TurnTime;
|
|
||||||
if (amount > 1)
|
|
||||||
{
|
|
||||||
amount = 1f;
|
|
||||||
}
|
|
||||||
|
|
||||||
quaternion q = math.slerp(self.From, self.To, amount);
|
|
||||||
unit.Rotation = q;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
moveTime -= self.NeedTime;
|
|
||||||
|
|
||||||
// 表示这个点还没走完,等下一帧再来
|
|
||||||
if (moveTime < 0)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 到这里说明这个点已经走完
|
|
||||||
|
|
||||||
// 如果是最后一个点
|
|
||||||
if (self.N >= self.Targets.Count - 1)
|
|
||||||
{
|
|
||||||
unit.Position = self.NextTarget;
|
|
||||||
unit.Rotation = self.To;
|
|
||||||
|
|
||||||
self.MoveFinish(ret);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
self.SetNextTarget();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void StartMove(this MoveComponent self)
|
|
||||||
{
|
|
||||||
self.BeginTime = TimeHelper.Now;
|
|
||||||
self.StartTime = self.BeginTime;
|
|
||||||
self.SetNextTarget();
|
|
||||||
|
|
||||||
// self.Scene.TimerComponent.Net.RepeatedTimer()
|
|
||||||
|
|
||||||
self.MoveTimer = self.Scene.TimerComponent.Net.RepeatedTimer(1000 * 60, () =>
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
self.MoveForward(true);
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
Log.Error($"move timer error: {self.Id}\n{e}");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void SetNextTarget(this MoveComponent self)
|
|
||||||
{
|
|
||||||
MapUnit unit = self.GetParent<MapUnit>();
|
|
||||||
|
|
||||||
++self.N;
|
|
||||||
|
|
||||||
// 时间计算用服务端的位置, 但是移动要用客户端的位置来插值
|
|
||||||
float3 v = self.GetFaceV();
|
|
||||||
float distance = math.length(v);
|
|
||||||
|
|
||||||
// 插值的起始点要以unit的真实位置来算
|
|
||||||
self.StartPos = unit.Position;
|
|
||||||
|
|
||||||
self.StartTime += self.NeedTime;
|
|
||||||
|
|
||||||
self.NeedTime = (long)(distance / self.Speed * 1000);
|
|
||||||
|
|
||||||
if (self.TurnTime > 0)
|
|
||||||
{
|
|
||||||
// 要用unit的位置
|
|
||||||
float3 faceV = self.GetFaceV();
|
|
||||||
if (math.lengthsq(faceV) < 0.0001f)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
self.From = unit.Rotation;
|
|
||||||
|
|
||||||
if (self.IsTurnHorizontal)
|
|
||||||
{
|
|
||||||
faceV.y = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Math.Abs(faceV.x) > 0.01 || Math.Abs(faceV.z) > 0.01)
|
|
||||||
{
|
|
||||||
self.To = quaternion.LookRotation(faceV, math.up());
|
|
||||||
}
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (self.TurnTime == 0) // turn time == 0 立即转向
|
|
||||||
{
|
|
||||||
float3 faceV = self.GetFaceV();
|
|
||||||
if (self.IsTurnHorizontal)
|
|
||||||
{
|
|
||||||
faceV.y = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Math.Abs(faceV.x) > 0.01 || Math.Abs(faceV.z) > 0.01)
|
|
||||||
{
|
|
||||||
self.To = quaternion.LookRotation(faceV, math.up());
|
|
||||||
unit.Rotation = self.To;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static float3 GetFaceV(this MoveComponent self)
|
|
||||||
{
|
|
||||||
return self.NextTarget - self.PreTarget;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static bool FlashTo(this MoveComponent self, float3 target)
|
|
||||||
{
|
|
||||||
MapUnit unit = self.GetParent<MapUnit>();
|
|
||||||
unit.Position = target;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ret: 停止的时候,移动协程的返回值
|
|
||||||
public static void Stop(this MoveComponent self, bool ret)
|
|
||||||
{
|
|
||||||
if (self.Targets.Count > 0)
|
|
||||||
{
|
|
||||||
self.MoveForward(ret);
|
|
||||||
}
|
|
||||||
|
|
||||||
self.MoveFinish(ret);
|
|
||||||
if (!ret)
|
|
||||||
{
|
|
||||||
self.Scene.EventComponent.Publish( new MoveStop() { Unit = self.GetParent<MapUnit>() });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void MoveFinish(this MoveComponent self, bool ret)
|
|
||||||
{
|
|
||||||
if (self.StartTime == 0)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
self.StartTime = 0;
|
|
||||||
self.StartPos = float3.zero;
|
|
||||||
self.BeginTime = 0;
|
|
||||||
self.NeedTime = 0;
|
|
||||||
self.Targets.Clear();
|
|
||||||
self.Speed = 0;
|
|
||||||
self.N = 0;
|
|
||||||
self.TurnTime = 0;
|
|
||||||
self.IsTurnHorizontal = false;
|
|
||||||
self.Scene.TimerComponent.Net.Remove(self.MoveTimer);
|
|
||||||
|
|
||||||
if (self.tcs != null)
|
|
||||||
{
|
|
||||||
var tcs = self.tcs;
|
|
||||||
self.tcs = null;
|
|
||||||
tcs.SetResult(ret);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,17 +1,14 @@
|
|||||||
namespace NBF.Fishing2
|
using NBC;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace NBF.Fishing2
|
||||||
{
|
{
|
||||||
public struct MoveStart
|
public struct MoveChange
|
||||||
{
|
{
|
||||||
public MapUnit Unit;
|
public MapUnit Unit;
|
||||||
}
|
public Vector3 Position;
|
||||||
|
public Quaternion Rotation;
|
||||||
public struct MoveStop
|
public Vector2Info Direction;
|
||||||
{
|
public bool IsStop;
|
||||||
public MapUnit Unit;
|
|
||||||
}
|
|
||||||
|
|
||||||
public struct MoveTimer
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -6,7 +6,7 @@ namespace NBF.Fishing2
|
|||||||
{
|
{
|
||||||
public class Role : Entity
|
public class Role : Entity
|
||||||
{
|
{
|
||||||
public long RoomId { get; set; }
|
public string RoomCode { get; set; }
|
||||||
public RoleInfo Info { get; set; }
|
public RoleInfo Info { get; set; }
|
||||||
|
|
||||||
|
|
||||||
@@ -14,7 +14,7 @@ namespace NBF.Fishing2
|
|||||||
{
|
{
|
||||||
protected override void Destroy(Role self)
|
protected override void Destroy(Role self)
|
||||||
{
|
{
|
||||||
self.RoomId = 0;
|
self.RoomCode = string.Empty;
|
||||||
self.Info = null;
|
self.Info = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -22,7 +22,7 @@ namespace NBF.Fishing2
|
|||||||
public async FTask GetRoleInfo()
|
public async FTask GetRoleInfo()
|
||||||
{
|
{
|
||||||
var response = (Game2C_GetRoleInfoResponse)await Net.Call(new C2Game_GetRoleInfoRequest());
|
var response = (Game2C_GetRoleInfoResponse)await Net.Call(new C2Game_GetRoleInfoRequest());
|
||||||
RoomId = response.RoomId;
|
RoomCode = response.RoomCode;
|
||||||
Info = response.RoleInfo;
|
Info = response.RoleInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -32,6 +32,12 @@ namespace NBF.Fishing2
|
|||||||
mapUnit.Id = Id;
|
mapUnit.Id = Id;
|
||||||
mapUnit.RoleInfo = new RoleSimpleInfo()
|
mapUnit.RoleInfo = new RoleSimpleInfo()
|
||||||
{
|
{
|
||||||
|
RoleId = Id,
|
||||||
|
NickName = Info.BaseInfo.NickName,
|
||||||
|
Head = Info.BaseInfo.Head,
|
||||||
|
Country = Info.BaseInfo.Country,
|
||||||
|
Level = Info.BaseInfo.Level,
|
||||||
|
Vip = Info.BaseInfo.Vip
|
||||||
};
|
};
|
||||||
|
|
||||||
return mapUnit;
|
return mapUnit;
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
using NBC;
|
using NBC;
|
||||||
using NBC.Entitas;
|
using NBC.Entitas;
|
||||||
using Unity.Mathematics;
|
using Unity.Mathematics;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
namespace NBF.Fishing2
|
namespace NBF.Fishing2
|
||||||
{
|
{
|
||||||
@@ -12,34 +13,34 @@ namespace NBF.Fishing2
|
|||||||
{
|
{
|
||||||
public int ConfigId { get; set; } //配置表id
|
public int ConfigId { get; set; } //配置表id
|
||||||
|
|
||||||
private float3 position; //坐标
|
private Vector3 position; //坐标
|
||||||
|
|
||||||
public float3 Position
|
public Vector3 Position
|
||||||
{
|
{
|
||||||
get => position;
|
get => position;
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
float3 oldPos = position;
|
Vector3 oldPos = position;
|
||||||
position = value;
|
position = value;
|
||||||
Scene.EventComponent.Publish(new ChangePosition() { MapUnit = this, OldPos = oldPos });
|
// Scene.EventComponent.Publish(new ChangePosition() { MapUnit = this, OldPos = oldPos });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public float3 Forward
|
public Vector3 Forward
|
||||||
{
|
{
|
||||||
get => math.mul(Rotation, math.forward());
|
get => math.mul(Rotation, math.forward());
|
||||||
set => Rotation = quaternion.LookRotation(value, math.up());
|
set => Rotation = Quaternion.LookRotation(value, math.up());
|
||||||
}
|
}
|
||||||
|
|
||||||
private quaternion rotation;
|
private Quaternion rotation;
|
||||||
|
|
||||||
public quaternion Rotation
|
public Quaternion Rotation
|
||||||
{
|
{
|
||||||
get => rotation;
|
get => rotation;
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
rotation = value;
|
rotation = value;
|
||||||
Scene.EventComponent.Publish(new ChangeRotation() { MapUnit = this });
|
// Scene.EventComponent.Publish(new ChangeRotation() { MapUnit = this });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -54,7 +55,7 @@ namespace NBF.Fishing2
|
|||||||
|
|
||||||
public void SetUnitInfo(MapUnitInfo unitInfo)
|
public void SetUnitInfo(MapUnitInfo unitInfo)
|
||||||
{
|
{
|
||||||
var moveComponent = GetOrAddComponent<MoveComponent>();
|
GetOrAddComponent<MoveComponent>();
|
||||||
GetOrAddComponent<ObjectWait>();
|
GetOrAddComponent<ObjectWait>();
|
||||||
var unitBasic = GetOrAddComponent<MapUnitBasic>();
|
var unitBasic = GetOrAddComponent<MapUnitBasic>();
|
||||||
unitBasic.UpdateInfo(unitInfo);
|
unitBasic.UpdateInfo(unitInfo);
|
||||||
|
|||||||
@@ -0,0 +1,331 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
using NBC;
|
||||||
|
using NBC.Entitas;
|
||||||
|
using NBC.Entitas.Interface;
|
||||||
|
using NBC.Helper;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.InputSystem;
|
||||||
|
|
||||||
|
namespace NBF.Fishing2
|
||||||
|
{
|
||||||
|
public class CharacterControllerComponent : Entity
|
||||||
|
{
|
||||||
|
public CharacterController characterController;
|
||||||
|
|
||||||
|
public readonly Queue<MoveState> MoveStateQueue = new Queue<MoveState>();
|
||||||
|
|
||||||
|
public Transform transform => characterController.transform;
|
||||||
|
private MoveState currentMoveState;
|
||||||
|
|
||||||
|
private Vector3 networkPosition;
|
||||||
|
// private Vector3 networkFacingDirection;
|
||||||
|
|
||||||
|
// 插值平滑参数
|
||||||
|
public float positionLerpSpeed = 10f;
|
||||||
|
public float rotationLerpSpeed = 10f;
|
||||||
|
|
||||||
|
|
||||||
|
[Tooltip("视角旋转敏感度")] public Vector2 sensitivity = new Vector2(0.015f, 0.015f);
|
||||||
|
public float minPitch = -40.0f;
|
||||||
|
public float maxPitch = 75.0f;
|
||||||
|
|
||||||
|
#region System
|
||||||
|
|
||||||
|
public class MoveComponentDestroySystem : DestroySystem<CharacterControllerComponent>
|
||||||
|
{
|
||||||
|
protected override void Destroy(CharacterControllerComponent self)
|
||||||
|
{
|
||||||
|
self.characterController = null;
|
||||||
|
var mapUnit = self.Parent as MapUnit;
|
||||||
|
if (mapUnit.IsSelf())
|
||||||
|
{
|
||||||
|
var inputComponent = self.Scene.GetComponent<InputComponent>();
|
||||||
|
if (inputComponent != null)
|
||||||
|
{
|
||||||
|
inputComponent.OnPlayerPerformed -= self.OnPlayerCanceled;
|
||||||
|
inputComponent.OnPlayerPerformed -= self.OnPlayerPerformed;
|
||||||
|
|
||||||
|
inputComponent.OnPlayerValueCanceled -= self.OnPlayerValueCanceled;
|
||||||
|
inputComponent.OnPlayerValuePerformed -= self.OnPlayerValuePerformed;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class MoveComponentAwakeSystem : AwakeSystem<CharacterControllerComponent>
|
||||||
|
{
|
||||||
|
protected override void Awake(CharacterControllerComponent self)
|
||||||
|
{
|
||||||
|
var unitUnityComponent = self.Parent.GetComponent<UnitUnityComponent>();
|
||||||
|
self.characterController = unitUnityComponent.GameObject.GetComponent<CharacterController>();
|
||||||
|
self.lastSyncedFacing = self.characterController.transform.forward;
|
||||||
|
var mapUnit = self.Parent as MapUnit;
|
||||||
|
if (mapUnit.IsSelf())
|
||||||
|
{
|
||||||
|
var inputComponent = self.Scene.GetComponent<InputComponent>();
|
||||||
|
inputComponent.OnPlayerPerformed += self.OnPlayerCanceled;
|
||||||
|
inputComponent.OnPlayerPerformed += self.OnPlayerPerformed;
|
||||||
|
|
||||||
|
inputComponent.OnPlayerValueCanceled += self.OnPlayerValueCanceled;
|
||||||
|
inputComponent.OnPlayerValuePerformed += self.OnPlayerValuePerformed;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class MoveComponentUpdateSystem : UpdateSystem<CharacterControllerComponent>
|
||||||
|
{
|
||||||
|
protected override void Update(CharacterControllerComponent self)
|
||||||
|
{
|
||||||
|
self.ProcessMoveStates();
|
||||||
|
self.CheckRotationSync();
|
||||||
|
var mapUnit = self.Parent as MapUnit;
|
||||||
|
mapUnit.Position = self.characterController.transform.position;
|
||||||
|
mapUnit.Rotation = self.characterController.transform.rotation;
|
||||||
|
var f = mapUnit.Forward;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
#region Input
|
||||||
|
|
||||||
|
private void OnPlayerPerformed(string action)
|
||||||
|
{
|
||||||
|
if (action == InputDef.Player.Run)
|
||||||
|
{
|
||||||
|
// Run = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnPlayerCanceled(string action)
|
||||||
|
{
|
||||||
|
if (action == InputDef.Player.Run)
|
||||||
|
{
|
||||||
|
// Run = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnPlayerValueCanceled(InputAction.CallbackContext context)
|
||||||
|
{
|
||||||
|
var name = context.action.name;
|
||||||
|
if (name == InputDef.Player.Move)
|
||||||
|
{
|
||||||
|
var v2 = context.ReadValue<Vector2>();
|
||||||
|
SendMoveMessage(v2, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnPlayerValuePerformed(InputAction.CallbackContext context)
|
||||||
|
{
|
||||||
|
var name = context.action.name;
|
||||||
|
if (name == InputDef.Player.Move)
|
||||||
|
{
|
||||||
|
var v2 = context.ReadValue<Vector2>();
|
||||||
|
SendMoveMessage(v2, false);
|
||||||
|
}
|
||||||
|
else if (name == InputDef.Player.Look)
|
||||||
|
{
|
||||||
|
var v2 = context.ReadValue<Vector2>();
|
||||||
|
UpdatePlayerRotation(v2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Message
|
||||||
|
|
||||||
|
private void SendMoveMessage(Vector3 movementInput, bool isStop = false)
|
||||||
|
{
|
||||||
|
var mapUnit = Parent as MapUnit;
|
||||||
|
|
||||||
|
Vector3 movementDirection = Vector3.zero;
|
||||||
|
|
||||||
|
movementDirection += Vector3.forward * movementInput.y;
|
||||||
|
movementDirection += Vector3.right * movementInput.x;
|
||||||
|
|
||||||
|
Net.Send(new C2Map_Move()
|
||||||
|
{
|
||||||
|
Direction = movementDirection.ToVector3Info(),
|
||||||
|
IsStop = isStop,
|
||||||
|
Timestamp = TimeHelper.Now,
|
||||||
|
Position = mapUnit.Position.ToVector3Info(),
|
||||||
|
Rotation = mapUnit.Forward.ToVector3Info(),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SendLookMessage()
|
||||||
|
{
|
||||||
|
Log.Info("发送朝向同步消息");
|
||||||
|
Net.Send(new C2Map_Look()
|
||||||
|
{
|
||||||
|
Rotation = characterController.transform.forward.ToVector3Info(),
|
||||||
|
Timestamp = TimeHelper.Now
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 接收服务器移动开始通知
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="startPosition"></param>
|
||||||
|
/// <param name="moveDirection"></param>
|
||||||
|
/// <param name="facingDirection"></param>
|
||||||
|
/// <param name="speed"></param>
|
||||||
|
/// <param name="timestamp"></param>
|
||||||
|
public void OnServerStartMove(Vector3 startPosition, Vector3 moveDirection, float speed, double timestamp)
|
||||||
|
{
|
||||||
|
MoveState moveState = new MoveState
|
||||||
|
{
|
||||||
|
startPosition = startPosition,
|
||||||
|
moveDirection = moveDirection.normalized,
|
||||||
|
moveSpeed = speed,
|
||||||
|
isMoving = true,
|
||||||
|
serverTimestamp = timestamp
|
||||||
|
};
|
||||||
|
|
||||||
|
MoveStateQueue.Enqueue(moveState);
|
||||||
|
Log.Info($"MoveStateQueue Count={MoveStateQueue.Count}");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 接收服务器移动停止通知
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="finalPosition"></param>
|
||||||
|
/// <param name="finalFacing"></param>
|
||||||
|
/// <param name="timestamp"></param>
|
||||||
|
public void OnServerStopMove(Vector3 finalPosition, double timestamp)
|
||||||
|
{
|
||||||
|
MoveState moveState = new MoveState
|
||||||
|
{
|
||||||
|
startPosition = finalPosition,
|
||||||
|
moveDirection = Vector3.zero,
|
||||||
|
moveSpeed = 0f,
|
||||||
|
isMoving = false,
|
||||||
|
serverTimestamp = timestamp
|
||||||
|
};
|
||||||
|
|
||||||
|
MoveStateQueue.Enqueue(moveState);
|
||||||
|
Log.Info($"MoveStateQueue Count={MoveStateQueue.Count}");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void OnServerLook(Vector3 rotation, double timestamp)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Move
|
||||||
|
|
||||||
|
private void ProcessMoveStates()
|
||||||
|
{
|
||||||
|
// 只有在当前状态不是移动状态时,才处理下一个状态
|
||||||
|
if (MoveStateQueue.Count > 0)
|
||||||
|
{
|
||||||
|
currentMoveState = MoveStateQueue.Dequeue();
|
||||||
|
|
||||||
|
if (currentMoveState.isMoving)
|
||||||
|
{
|
||||||
|
StartMovement(currentMoveState);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
StopMovement(currentMoveState);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 如果正在移动,持续更新
|
||||||
|
if (currentMoveState.isMoving)
|
||||||
|
{
|
||||||
|
UpdateMovement();
|
||||||
|
|
||||||
|
// 检查是否需要自动停止(可选)
|
||||||
|
// 例如基于时间或距离的条件
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void StartMovement(MoveState moveState)
|
||||||
|
{
|
||||||
|
networkPosition = moveState.startPosition;
|
||||||
|
// networkFacingDirection = moveState.currentFacing;
|
||||||
|
|
||||||
|
Debug.Log($"开始移动 - 位置: {moveState.startPosition}");
|
||||||
|
}
|
||||||
|
|
||||||
|
private void StopMovement(MoveState moveState)
|
||||||
|
{
|
||||||
|
networkPosition = moveState.startPosition;
|
||||||
|
// networkFacingDirection = moveState.currentFacing;
|
||||||
|
|
||||||
|
Debug.Log($"停止移动 - 最终位置: {moveState.startPosition}");
|
||||||
|
}
|
||||||
|
|
||||||
|
private void UpdateMovement()
|
||||||
|
{
|
||||||
|
var movementDirection =
|
||||||
|
currentMoveState.moveDirection.relativeTo(BaseCamera.Main.transform, characterController.transform.up);
|
||||||
|
|
||||||
|
Vector3 movement = movementDirection * currentMoveState.moveSpeed * Time.deltaTime;
|
||||||
|
networkPosition += movement;
|
||||||
|
characterController.Move(movement);
|
||||||
|
|
||||||
|
// 如果移动方向不为零,可以自动更新朝向
|
||||||
|
if (currentMoveState.moveDirection != Vector3.zero)
|
||||||
|
{
|
||||||
|
// networkFacingDirection = currentMoveState.moveDirection;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Look
|
||||||
|
|
||||||
|
public float rotationSyncInterval = 0.15f;
|
||||||
|
public float minRotationChange = 10f;
|
||||||
|
|
||||||
|
private Vector3 _rotationInput = Vector3.zero;
|
||||||
|
private float _cameraPitch;
|
||||||
|
private float rotationSyncTimer;
|
||||||
|
private Vector3 lastSyncedFacing;
|
||||||
|
|
||||||
|
private void UpdatePlayerRotation(Vector2 lookValue)
|
||||||
|
{
|
||||||
|
// Look
|
||||||
|
Vector2 lookInput = lookValue * sensitivity;
|
||||||
|
|
||||||
|
if (lookInput.x != 0.0f)
|
||||||
|
{
|
||||||
|
_rotationInput.y += lookInput.x;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Player.CameraRoot.transform.localRotation = Quaternion.Euler(_cameraPitch, 0.0f, 0.0f);
|
||||||
|
if (_rotationInput != Vector3.zero)
|
||||||
|
{
|
||||||
|
characterController.transform.rotation *= Quaternion.Euler(_rotationInput);
|
||||||
|
_rotationInput = Vector3.zero;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 检查朝向同步
|
||||||
|
private void CheckRotationSync()
|
||||||
|
{
|
||||||
|
rotationSyncTimer += Time.deltaTime;
|
||||||
|
if (rotationSyncTimer >= rotationSyncInterval)
|
||||||
|
{
|
||||||
|
float angleChange = Vector3.Angle(transform.forward, lastSyncedFacing);
|
||||||
|
|
||||||
|
if (angleChange >= minRotationChange)
|
||||||
|
{
|
||||||
|
SendLookMessage();
|
||||||
|
lastSyncedFacing = transform.forward;
|
||||||
|
rotationSyncTimer = 0f;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 36fb267f0f5149caa23ac1b6cf005067
|
||||||
|
timeCreated: 1757164955
|
||||||
@@ -22,6 +22,7 @@ namespace NBF.Fishing2
|
|||||||
GameObject = gameObject;
|
GameObject = gameObject;
|
||||||
Transform = gameObject.transform;
|
Transform = gameObject.transform;
|
||||||
Animator = gameObject.GetComponent<Animator>();
|
Animator = gameObject.GetComponent<Animator>();
|
||||||
|
Parent.AddComponent<CharacterControllerComponent>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -4,9 +4,9 @@ using UnityEngine;
|
|||||||
|
|
||||||
namespace NBF
|
namespace NBF
|
||||||
{
|
{
|
||||||
public class Global : MonoBehaviour
|
public class Game : MonoBehaviour
|
||||||
{
|
{
|
||||||
public static Global Instance { get; private set; }
|
public static Game Instance { get; private set; }
|
||||||
|
|
||||||
|
|
||||||
public static InputComponent Input;
|
public static InputComponent Input;
|
||||||
@@ -21,10 +21,13 @@ namespace NBF
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public static CameraScriptObject CameraConfig { get; private set; }
|
public static CameraScriptObject CameraConfig { get; private set; }
|
||||||
|
|
||||||
|
public static long SelfId;
|
||||||
private void Awake()
|
private void Awake()
|
||||||
{
|
{
|
||||||
Instance = this;
|
Instance = this;
|
||||||
CameraConfig = Resources.Load<CameraScriptObject>(nameof(CameraConfig));
|
CameraConfig = Resources.Load<CameraScriptObject>(nameof(CameraConfig));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -181,7 +181,7 @@ namespace NBC
|
|||||||
[ProtoMember(1)]
|
[ProtoMember(1)]
|
||||||
public int MapId { get; set; }
|
public int MapId { get; set; }
|
||||||
[ProtoMember(2)]
|
[ProtoMember(2)]
|
||||||
public long RoomId { get; set; }
|
public string RoomId { get; set; }
|
||||||
}
|
}
|
||||||
[ProtoContract]
|
[ProtoContract]
|
||||||
public partial class Map2C_EnterMapResponse : AMessage, ICustomRouteResponse, IProto
|
public partial class Map2C_EnterMapResponse : AMessage, ICustomRouteResponse, IProto
|
||||||
|
|||||||
@@ -33,6 +33,26 @@ namespace NBC
|
|||||||
public float z { get; set; }
|
public float z { get; set; }
|
||||||
}
|
}
|
||||||
[ProtoContract]
|
[ProtoContract]
|
||||||
|
public partial class Vector2Info : AMessage, IProto
|
||||||
|
{
|
||||||
|
public static Vector2Info Create(Scene scene)
|
||||||
|
{
|
||||||
|
return scene.MessagePoolComponent.Rent<Vector2Info>();
|
||||||
|
}
|
||||||
|
public override void Dispose()
|
||||||
|
{
|
||||||
|
x = default;
|
||||||
|
y = default;
|
||||||
|
#if FANTASY_NET || FANTASY_UNITY
|
||||||
|
GetScene().MessagePoolComponent.Return<Vector2Info>(this);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
[ProtoMember(1)]
|
||||||
|
public float x { get; set; }
|
||||||
|
[ProtoMember(2)]
|
||||||
|
public float y { get; set; }
|
||||||
|
}
|
||||||
|
[ProtoContract]
|
||||||
public partial class QuaternionInfo : AMessage, IProto
|
public partial class QuaternionInfo : AMessage, IProto
|
||||||
{
|
{
|
||||||
public static QuaternionInfo Create(Scene scene)
|
public static QuaternionInfo Create(Scene scene)
|
||||||
@@ -115,7 +135,8 @@ namespace NBC
|
|||||||
{
|
{
|
||||||
Id = default;
|
Id = default;
|
||||||
RoleInfo = default;
|
RoleInfo = default;
|
||||||
Location = default;
|
Position = default;
|
||||||
|
Rotation = default;
|
||||||
State = default;
|
State = default;
|
||||||
Gears = default;
|
Gears = default;
|
||||||
FishingInfo = default;
|
FishingInfo = default;
|
||||||
@@ -129,34 +150,16 @@ namespace NBC
|
|||||||
[ProtoMember(2)]
|
[ProtoMember(2)]
|
||||||
public RoleSimpleInfo RoleInfo { get; set; }
|
public RoleSimpleInfo RoleInfo { get; set; }
|
||||||
[ProtoMember(3)]
|
[ProtoMember(3)]
|
||||||
public MapUnitPositionInfo Location { get; set; }
|
public Vector3Info Position { get; set; }
|
||||||
[ProtoMember(4)]
|
[ProtoMember(4)]
|
||||||
public UnitStateInfo State { get; set; }
|
public Vector3Info Rotation { get; set; }
|
||||||
[ProtoMember(5)]
|
[ProtoMember(5)]
|
||||||
public GearInfo Gears { get; set; }
|
public UnitStateInfo State { get; set; }
|
||||||
[ProtoMember(6)]
|
[ProtoMember(6)]
|
||||||
public UnitFishingInfo FishingInfo { get; set; }
|
public GearInfo Gears { get; set; }
|
||||||
[ProtoMember(7)]
|
[ProtoMember(7)]
|
||||||
|
public UnitFishingInfo FishingInfo { get; set; }
|
||||||
|
[ProtoMember(8)]
|
||||||
public List<KeyValueInt32> KV = new List<KeyValueInt32>();
|
public List<KeyValueInt32> KV = new List<KeyValueInt32>();
|
||||||
}
|
}
|
||||||
[ProtoContract]
|
|
||||||
public partial class MapUnitPositionInfo : AMessage, IProto
|
|
||||||
{
|
|
||||||
public static MapUnitPositionInfo Create(Scene scene)
|
|
||||||
{
|
|
||||||
return scene.MessagePoolComponent.Rent<MapUnitPositionInfo>();
|
|
||||||
}
|
|
||||||
public override void Dispose()
|
|
||||||
{
|
|
||||||
Position = default;
|
|
||||||
Rotation = default;
|
|
||||||
#if FANTASY_NET || FANTASY_UNITY
|
|
||||||
GetScene().MessagePoolComponent.Return<MapUnitPositionInfo>(this);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
[ProtoMember(1)]
|
|
||||||
public Vector3Info Position { get; set; }
|
|
||||||
[ProtoMember(2)]
|
|
||||||
public QuaternionInfo Rotation { get; set; }
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -151,7 +151,7 @@ namespace NBC
|
|||||||
{
|
{
|
||||||
ErrorCode = default;
|
ErrorCode = default;
|
||||||
RoleInfo = default;
|
RoleInfo = default;
|
||||||
RoomId = default;
|
RoomCode = default;
|
||||||
#if FANTASY_NET || FANTASY_UNITY
|
#if FANTASY_NET || FANTASY_UNITY
|
||||||
GetScene().MessagePoolComponent.Return<Game2C_GetRoleInfoResponse>(this);
|
GetScene().MessagePoolComponent.Return<Game2C_GetRoleInfoResponse>(this);
|
||||||
#endif
|
#endif
|
||||||
@@ -160,7 +160,7 @@ namespace NBC
|
|||||||
[ProtoMember(1)]
|
[ProtoMember(1)]
|
||||||
public RoleInfo RoleInfo { get; set; }
|
public RoleInfo RoleInfo { get; set; }
|
||||||
[ProtoMember(2)]
|
[ProtoMember(2)]
|
||||||
public long RoomId { get; set; }
|
public string RoomCode { get; set; }
|
||||||
[ProtoMember(3)]
|
[ProtoMember(3)]
|
||||||
public uint ErrorCode { get; set; }
|
public uint ErrorCode { get; set; }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,45 +18,46 @@ namespace Fantasy
|
|||||||
public const uint G2C_RepeatLogin = 134227729;
|
public const uint G2C_RepeatLogin = 134227729;
|
||||||
public const uint C2Game_GetRoleInfoRequest = 2281711379;
|
public const uint C2Game_GetRoleInfoRequest = 2281711379;
|
||||||
public const uint Game2C_GetRoleInfoResponse = 2415929107;
|
public const uint Game2C_GetRoleInfoResponse = 2415929107;
|
||||||
public const uint C2Map_EnterRoomRequest = 2281711380;
|
public const uint Map2C_RoleEnterRoomNotify = 2147493650;
|
||||||
public const uint Map2C_EnterRoomResponse = 2415929108;
|
public const uint Map2C_RoleExitRoomNotify = 2147493651;
|
||||||
public const uint C2Map_Move = 2147493650;
|
public const uint Map2C_RoleStateNotify = 2147493652;
|
||||||
public const uint Map2C_RoleEnterMapNotify = 2147493651;
|
public const uint Map2C_RoleGearStateNotify = 2147493653;
|
||||||
public const uint Map2C_RoleExitMapNotify = 2147493652;
|
public const uint Map2C_RoleGearChangeNotify = 2147493654;
|
||||||
public const uint Map2C_RoleStateNotify = 2147493653;
|
public const uint C2Map_Move = 2147493655;
|
||||||
public const uint Map2C_RoleGearStateNotify = 2147493654;
|
public const uint C2Map_Look = 2147493656;
|
||||||
public const uint Map2C_RoleGearChangeNotify = 2147493655;
|
public const uint Map2C_MoveNotify = 2147493657;
|
||||||
public const uint C2S_GetConversationsRequest = 2281711381;
|
public const uint Map2C_LookeNotify = 2147493658;
|
||||||
public const uint S2C_GetConversationsResponse = 2415929109;
|
public const uint C2S_GetConversationsRequest = 2281711380;
|
||||||
public const uint C2S_SendMailRequest = 2281711382;
|
public const uint S2C_GetConversationsResponse = 2415929108;
|
||||||
public const uint S2C_SendMailResponse = 2415929110;
|
public const uint C2S_SendMailRequest = 2281711381;
|
||||||
public const uint C2S_DeleteMailRequest = 2281711383;
|
public const uint S2C_SendMailResponse = 2415929109;
|
||||||
public const uint S2C_DeleteMailResponse = 2415929111;
|
public const uint C2S_DeleteMailRequest = 2281711382;
|
||||||
public const uint S2C_HaveMail = 2147493656;
|
public const uint S2C_DeleteMailResponse = 2415929110;
|
||||||
public const uint S2C_MailState = 2147493657;
|
public const uint S2C_HaveMail = 2147493659;
|
||||||
public const uint C2S_CreateChannelRequest = 2281711384;
|
public const uint S2C_MailState = 2147493660;
|
||||||
public const uint S2C_CreateChannelResponse = 2415929112;
|
public const uint C2S_CreateChannelRequest = 2281711383;
|
||||||
public const uint C2S_JoinChannelRequest = 2281711385;
|
public const uint S2C_CreateChannelResponse = 2415929111;
|
||||||
public const uint S2C_JoinChannelResponse = 2415929113;
|
public const uint C2S_JoinChannelRequest = 2281711384;
|
||||||
public const uint C2S_SendMessageRequest = 2281711386;
|
public const uint S2C_JoinChannelResponse = 2415929112;
|
||||||
public const uint S2C_SendMessageResponse = 2415929114;
|
public const uint C2S_SendMessageRequest = 2281711385;
|
||||||
public const uint S2C_Message = 2147493658;
|
public const uint S2C_SendMessageResponse = 2415929113;
|
||||||
public const uint C2S_CreateClubRequest = 2281711387;
|
public const uint S2C_Message = 2147493661;
|
||||||
public const uint S2C_CreateClubResponse = 2415929115;
|
public const uint C2S_CreateClubRequest = 2281711386;
|
||||||
public const uint C2S_GetClubInfoRequest = 2281711388;
|
public const uint S2C_CreateClubResponse = 2415929114;
|
||||||
public const uint S2C_GetClubInfoResponse = 2415929116;
|
public const uint C2S_GetClubInfoRequest = 2281711387;
|
||||||
public const uint C2S_GetMemberListRequest = 2281711389;
|
public const uint S2C_GetClubInfoResponse = 2415929115;
|
||||||
public const uint S2C_GetMemberListResponse = 2415929117;
|
public const uint C2S_GetMemberListRequest = 2281711388;
|
||||||
public const uint C2S_GetClubListRequest = 2281711390;
|
public const uint S2C_GetMemberListResponse = 2415929116;
|
||||||
public const uint S2C_GetClubListResponse = 2415929118;
|
public const uint C2S_GetClubListRequest = 2281711389;
|
||||||
public const uint C2S_JoinClubRequest = 2281711391;
|
public const uint S2C_GetClubListResponse = 2415929117;
|
||||||
public const uint S2C_JoinClubResponse = 2415929119;
|
public const uint C2S_JoinClubRequest = 2281711390;
|
||||||
public const uint C2S_LeaveClubRequest = 2281711392;
|
public const uint S2C_JoinClubResponse = 2415929118;
|
||||||
public const uint S2C_LeaveClubResponse = 2415929120;
|
public const uint C2S_LeaveClubRequest = 2281711391;
|
||||||
public const uint C2S_DissolveClubRequest = 2281711393;
|
public const uint S2C_LeaveClubResponse = 2415929119;
|
||||||
public const uint S2C_DissolveClubResponse = 2415929121;
|
public const uint C2S_DissolveClubRequest = 2281711392;
|
||||||
public const uint C2S_DisposeJoinRequest = 2281711394;
|
public const uint S2C_DissolveClubResponse = 2415929120;
|
||||||
public const uint S2C_DisposeJoinResponse = 2415929122;
|
public const uint C2S_DisposeJoinRequest = 2281711393;
|
||||||
public const uint S2C_ClubChange = 2147493659;
|
public const uint S2C_DisposeJoinResponse = 2415929121;
|
||||||
|
public const uint S2C_ClubChange = 2147493662;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,96 +9,24 @@ using NBC.Serialize;
|
|||||||
|
|
||||||
namespace NBC
|
namespace NBC
|
||||||
{
|
{
|
||||||
[ProtoContract]
|
|
||||||
public partial class C2Map_EnterRoomRequest : AMessage, ICustomRouteRequest, IProto
|
|
||||||
{
|
|
||||||
public static C2Map_EnterRoomRequest Create(Scene scene)
|
|
||||||
{
|
|
||||||
return scene.MessagePoolComponent.Rent<C2Map_EnterRoomRequest>();
|
|
||||||
}
|
|
||||||
public override void Dispose()
|
|
||||||
{
|
|
||||||
MapId = default;
|
|
||||||
Password = default;
|
|
||||||
#if FANTASY_NET || FANTASY_UNITY
|
|
||||||
GetScene().MessagePoolComponent.Return<C2Map_EnterRoomRequest>(this);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
[ProtoIgnore]
|
|
||||||
public Map2C_EnterRoomResponse ResponseType { get; set; }
|
|
||||||
public uint OpCode() { return OuterOpcode.C2Map_EnterRoomRequest; }
|
|
||||||
[ProtoIgnore]
|
|
||||||
public int RouteType => Fantasy.RouteType.MapRoute;
|
|
||||||
[ProtoMember(1)]
|
|
||||||
public int MapId { get; set; }
|
|
||||||
[ProtoMember(2)]
|
|
||||||
public string Password { get; set; }
|
|
||||||
}
|
|
||||||
[ProtoContract]
|
|
||||||
public partial class Map2C_EnterRoomResponse : AMessage, ICustomRouteResponse, IProto
|
|
||||||
{
|
|
||||||
public static Map2C_EnterRoomResponse Create(Scene scene)
|
|
||||||
{
|
|
||||||
return scene.MessagePoolComponent.Rent<Map2C_EnterRoomResponse>();
|
|
||||||
}
|
|
||||||
public override void Dispose()
|
|
||||||
{
|
|
||||||
ErrorCode = default;
|
|
||||||
MapId = default;
|
|
||||||
RoomId = default;
|
|
||||||
#if FANTASY_NET || FANTASY_UNITY
|
|
||||||
GetScene().MessagePoolComponent.Return<Map2C_EnterRoomResponse>(this);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
public uint OpCode() { return OuterOpcode.Map2C_EnterRoomResponse; }
|
|
||||||
[ProtoMember(1)]
|
|
||||||
public int MapId { get; set; }
|
|
||||||
[ProtoMember(2)]
|
|
||||||
public long RoomId { get; set; }
|
|
||||||
[ProtoMember(3)]
|
|
||||||
public uint ErrorCode { get; set; }
|
|
||||||
}
|
|
||||||
[ProtoContract]
|
|
||||||
public partial class C2Map_Move : AMessage, ICustomRouteMessage, IProto
|
|
||||||
{
|
|
||||||
public static C2Map_Move Create(Scene scene)
|
|
||||||
{
|
|
||||||
return scene.MessagePoolComponent.Rent<C2Map_Move>();
|
|
||||||
}
|
|
||||||
public override void Dispose()
|
|
||||||
{
|
|
||||||
Location = default;
|
|
||||||
IsStop = default;
|
|
||||||
#if FANTASY_NET || FANTASY_UNITY
|
|
||||||
GetScene().MessagePoolComponent.Return<C2Map_Move>(this);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
public uint OpCode() { return OuterOpcode.C2Map_Move; }
|
|
||||||
[ProtoIgnore]
|
|
||||||
public int RouteType => Fantasy.RouteType.MapRoute;
|
|
||||||
[ProtoMember(1)]
|
|
||||||
public MapUnitPositionInfo Location { get; set; }
|
|
||||||
[ProtoMember(2)]
|
|
||||||
public bool IsStop { get; set; }
|
|
||||||
}
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 用户进入地图
|
/// 用户进入地图
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[ProtoContract]
|
[ProtoContract]
|
||||||
public partial class Map2C_RoleEnterMapNotify : AMessage, ICustomRouteMessage, IProto
|
public partial class Map2C_RoleEnterRoomNotify : AMessage, ICustomRouteMessage, IProto
|
||||||
{
|
{
|
||||||
public static Map2C_RoleEnterMapNotify Create(Scene scene)
|
public static Map2C_RoleEnterRoomNotify Create(Scene scene)
|
||||||
{
|
{
|
||||||
return scene.MessagePoolComponent.Rent<Map2C_RoleEnterMapNotify>();
|
return scene.MessagePoolComponent.Rent<Map2C_RoleEnterRoomNotify>();
|
||||||
}
|
}
|
||||||
public override void Dispose()
|
public override void Dispose()
|
||||||
{
|
{
|
||||||
Info = default;
|
Info = default;
|
||||||
#if FANTASY_NET || FANTASY_UNITY
|
#if FANTASY_NET || FANTASY_UNITY
|
||||||
GetScene().MessagePoolComponent.Return<Map2C_RoleEnterMapNotify>(this);
|
GetScene().MessagePoolComponent.Return<Map2C_RoleEnterRoomNotify>(this);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
public uint OpCode() { return OuterOpcode.Map2C_RoleEnterMapNotify; }
|
public uint OpCode() { return OuterOpcode.Map2C_RoleEnterRoomNotify; }
|
||||||
[ProtoIgnore]
|
[ProtoIgnore]
|
||||||
public int RouteType => Fantasy.RouteType.MapRoute;
|
public int RouteType => Fantasy.RouteType.MapRoute;
|
||||||
[ProtoMember(1)]
|
[ProtoMember(1)]
|
||||||
@@ -108,20 +36,20 @@ namespace NBC
|
|||||||
/// 用户离开地图
|
/// 用户离开地图
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[ProtoContract]
|
[ProtoContract]
|
||||||
public partial class Map2C_RoleExitMapNotify : AMessage, ICustomRouteMessage, IProto
|
public partial class Map2C_RoleExitRoomNotify : AMessage, ICustomRouteMessage, IProto
|
||||||
{
|
{
|
||||||
public static Map2C_RoleExitMapNotify Create(Scene scene)
|
public static Map2C_RoleExitRoomNotify Create(Scene scene)
|
||||||
{
|
{
|
||||||
return scene.MessagePoolComponent.Rent<Map2C_RoleExitMapNotify>();
|
return scene.MessagePoolComponent.Rent<Map2C_RoleExitRoomNotify>();
|
||||||
}
|
}
|
||||||
public override void Dispose()
|
public override void Dispose()
|
||||||
{
|
{
|
||||||
Id = default;
|
Id = default;
|
||||||
#if FANTASY_NET || FANTASY_UNITY
|
#if FANTASY_NET || FANTASY_UNITY
|
||||||
GetScene().MessagePoolComponent.Return<Map2C_RoleExitMapNotify>(this);
|
GetScene().MessagePoolComponent.Return<Map2C_RoleExitRoomNotify>(this);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
public uint OpCode() { return OuterOpcode.Map2C_RoleExitMapNotify; }
|
public uint OpCode() { return OuterOpcode.Map2C_RoleExitRoomNotify; }
|
||||||
[ProtoIgnore]
|
[ProtoIgnore]
|
||||||
public int RouteType => Fantasy.RouteType.MapRoute;
|
public int RouteType => Fantasy.RouteType.MapRoute;
|
||||||
[ProtoMember(1)]
|
[ProtoMember(1)]
|
||||||
@@ -205,11 +133,66 @@ namespace NBC
|
|||||||
[ProtoMember(2)]
|
[ProtoMember(2)]
|
||||||
public GearInfo Gears { get; set; }
|
public GearInfo Gears { get; set; }
|
||||||
}
|
}
|
||||||
|
[ProtoContract]
|
||||||
|
public partial class C2Map_Move : AMessage, ICustomRouteMessage, IProto
|
||||||
|
{
|
||||||
|
public static C2Map_Move Create(Scene scene)
|
||||||
|
{
|
||||||
|
return scene.MessagePoolComponent.Rent<C2Map_Move>();
|
||||||
|
}
|
||||||
|
public override void Dispose()
|
||||||
|
{
|
||||||
|
Position = default;
|
||||||
|
Rotation = default;
|
||||||
|
Direction = default;
|
||||||
|
IsStop = default;
|
||||||
|
Timestamp = default;
|
||||||
|
#if FANTASY_NET || FANTASY_UNITY
|
||||||
|
GetScene().MessagePoolComponent.Return<C2Map_Move>(this);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
public uint OpCode() { return OuterOpcode.C2Map_Move; }
|
||||||
|
[ProtoIgnore]
|
||||||
|
public int RouteType => Fantasy.RouteType.MapRoute;
|
||||||
|
[ProtoMember(1)]
|
||||||
|
public Vector3Info Position { get; set; }
|
||||||
|
[ProtoMember(2)]
|
||||||
|
public Vector3Info Rotation { get; set; }
|
||||||
|
[ProtoMember(3)]
|
||||||
|
public Vector3Info Direction { get; set; }
|
||||||
|
[ProtoMember(4)]
|
||||||
|
public bool IsStop { get; set; }
|
||||||
|
[ProtoMember(5)]
|
||||||
|
public long Timestamp { get; set; }
|
||||||
|
}
|
||||||
|
[ProtoContract]
|
||||||
|
public partial class C2Map_Look : AMessage, ICustomRouteMessage, IProto
|
||||||
|
{
|
||||||
|
public static C2Map_Look Create(Scene scene)
|
||||||
|
{
|
||||||
|
return scene.MessagePoolComponent.Rent<C2Map_Look>();
|
||||||
|
}
|
||||||
|
public override void Dispose()
|
||||||
|
{
|
||||||
|
Rotation = default;
|
||||||
|
Timestamp = default;
|
||||||
|
#if FANTASY_NET || FANTASY_UNITY
|
||||||
|
GetScene().MessagePoolComponent.Return<C2Map_Look>(this);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
public uint OpCode() { return OuterOpcode.C2Map_Look; }
|
||||||
|
[ProtoIgnore]
|
||||||
|
public int RouteType => Fantasy.RouteType.MapRoute;
|
||||||
|
[ProtoMember(1)]
|
||||||
|
public Vector3Info Rotation { get; set; }
|
||||||
|
[ProtoMember(2)]
|
||||||
|
public long Timestamp { get; set; }
|
||||||
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 玩家位置变化
|
/// 玩家移动推送
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[ProtoContract]
|
[ProtoContract]
|
||||||
public partial class Map2C_MoveNotify : AMessage, IProto
|
public partial class Map2C_MoveNotify : AMessage, ICustomRouteMessage, IProto
|
||||||
{
|
{
|
||||||
public static Map2C_MoveNotify Create(Scene scene)
|
public static Map2C_MoveNotify Create(Scene scene)
|
||||||
{
|
{
|
||||||
@@ -218,14 +201,58 @@ namespace NBC
|
|||||||
public override void Dispose()
|
public override void Dispose()
|
||||||
{
|
{
|
||||||
Id = default;
|
Id = default;
|
||||||
Location = default;
|
Position = default;
|
||||||
|
Rotation = default;
|
||||||
|
Direction = default;
|
||||||
|
IsStop = default;
|
||||||
|
Timestamp = default;
|
||||||
#if FANTASY_NET || FANTASY_UNITY
|
#if FANTASY_NET || FANTASY_UNITY
|
||||||
GetScene().MessagePoolComponent.Return<Map2C_MoveNotify>(this);
|
GetScene().MessagePoolComponent.Return<Map2C_MoveNotify>(this);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
public uint OpCode() { return OuterOpcode.Map2C_MoveNotify; }
|
||||||
|
[ProtoIgnore]
|
||||||
|
public int RouteType => Fantasy.RouteType.MapRoute;
|
||||||
[ProtoMember(1)]
|
[ProtoMember(1)]
|
||||||
public long Id { get; set; }
|
public long Id { get; set; }
|
||||||
[ProtoMember(2)]
|
[ProtoMember(2)]
|
||||||
public MapUnitPositionInfo Location { get; set; }
|
public Vector3Info Position { get; set; }
|
||||||
|
[ProtoMember(3)]
|
||||||
|
public Vector3Info Rotation { get; set; }
|
||||||
|
[ProtoMember(4)]
|
||||||
|
public Vector3Info Direction { get; set; }
|
||||||
|
[ProtoMember(5)]
|
||||||
|
public bool IsStop { get; set; }
|
||||||
|
[ProtoMember(6)]
|
||||||
|
public long Timestamp { get; set; }
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 玩家旋转推送
|
||||||
|
/// </summary>
|
||||||
|
[ProtoContract]
|
||||||
|
public partial class Map2C_LookeNotify : AMessage, ICustomRouteMessage, IProto
|
||||||
|
{
|
||||||
|
public static Map2C_LookeNotify Create(Scene scene)
|
||||||
|
{
|
||||||
|
return scene.MessagePoolComponent.Rent<Map2C_LookeNotify>();
|
||||||
|
}
|
||||||
|
public override void Dispose()
|
||||||
|
{
|
||||||
|
Id = default;
|
||||||
|
Rotation = default;
|
||||||
|
Timestamp = default;
|
||||||
|
#if FANTASY_NET || FANTASY_UNITY
|
||||||
|
GetScene().MessagePoolComponent.Return<Map2C_LookeNotify>(this);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
public uint OpCode() { return OuterOpcode.Map2C_LookeNotify; }
|
||||||
|
[ProtoIgnore]
|
||||||
|
public int RouteType => Fantasy.RouteType.MapRoute;
|
||||||
|
[ProtoMember(1)]
|
||||||
|
public long Id { get; set; }
|
||||||
|
[ProtoMember(2)]
|
||||||
|
public Vector3Info Rotation { get; set; }
|
||||||
|
[ProtoMember(3)]
|
||||||
|
public long Timestamp { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Threading.Tasks;
|
||||||
using FairyGUI;
|
using FairyGUI;
|
||||||
using NBC;
|
using NBC;
|
||||||
|
using NBF.Fishing2;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.Video;
|
using UnityEngine.Video;
|
||||||
|
|
||||||
@@ -99,12 +101,12 @@ namespace NBF
|
|||||||
|
|
||||||
public void StartGame()
|
public void StartGame()
|
||||||
{
|
{
|
||||||
|
Screen.SetResolution(1280, 720, FullScreenMode.Windowed);
|
||||||
PermanentCommon.Init();
|
PermanentCommon.Init();
|
||||||
InputDef.LoadIcon();
|
InputDef.LoadIcon();
|
||||||
// UI.Inst.OpenUI<FishingShopPanel>();
|
// UI.Inst.OpenUI<FishingShopPanel>();
|
||||||
LoadData();
|
LoadData();
|
||||||
CommonTopPanel.Show();
|
OpenUI().Coroutine();
|
||||||
LoginPanel.Show();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void LoadData()
|
private void LoadData()
|
||||||
@@ -112,6 +114,13 @@ namespace NBF
|
|||||||
ConfigAssets.Init();
|
ConfigAssets.Init();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private async FTask OpenUI()
|
||||||
|
{
|
||||||
|
await Task.Delay(100);
|
||||||
|
CommonTopPanel.Show();
|
||||||
|
LoginPanel.Show();
|
||||||
|
}
|
||||||
|
|
||||||
#region New
|
#region New
|
||||||
|
|
||||||
public ControllerType controllerType = ControllerType.GamePad;
|
public ControllerType controllerType = ControllerType.GamePad;
|
||||||
|
|||||||
@@ -39,8 +39,8 @@ namespace NBF
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
Log.Error($"showCursor={showCursor}");
|
Log.Error($"showCursor={showCursor}");
|
||||||
InputManager.IsUIStopInput = showCursor;
|
// Game.Input.IsUIStopInput = showCursor;
|
||||||
InputManager.SetMouseCursor(showCursor);
|
// Game.Input.SetMouseCursor(showCursor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,212 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
using NBC;
|
|
||||||
// using Rewired;
|
|
||||||
using UnityEngine;
|
|
||||||
using UnityEngine.InputSystem;
|
|
||||||
|
|
||||||
namespace NBF
|
|
||||||
{
|
|
||||||
public enum ControllerType
|
|
||||||
{
|
|
||||||
KeyboardMouse = 0,
|
|
||||||
GamePad = 1
|
|
||||||
}
|
|
||||||
|
|
||||||
public class InputManager : MonoService<InputManager>
|
|
||||||
{
|
|
||||||
public static bool IsOp1;
|
|
||||||
public static bool IsOp2;
|
|
||||||
|
|
||||||
public static event Action<bool> OnOp1Action;
|
|
||||||
public static event Action<bool> OnOp2Action;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 执行输入事件
|
|
||||||
/// </summary>
|
|
||||||
public static event Action<string> OnUIPerformed;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 执行输入事件完毕
|
|
||||||
/// </summary>
|
|
||||||
public static event Action<string> OnUICanceled;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 执行输入事件
|
|
||||||
/// </summary>
|
|
||||||
public static event Action<string> OnPlayerPerformed;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 执行输入事件完毕
|
|
||||||
/// </summary>
|
|
||||||
public static event Action<string> OnPlayerCanceled;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 触发交互游戏对象
|
|
||||||
/// </summary>
|
|
||||||
public static event Action<InteractiveObject> OnInteractiveObjectAction;
|
|
||||||
|
|
||||||
public static PlayerInputControl PlayerInputControl { get; private set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 手柄输入
|
|
||||||
/// </summary>
|
|
||||||
public static bool IsControllerInput;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// ui阻止游戏输入
|
|
||||||
/// </summary>
|
|
||||||
public static bool IsUIStopInput;
|
|
||||||
|
|
||||||
public static ControllerType ControllerType = ControllerType.KeyboardMouse;
|
|
||||||
|
|
||||||
protected override void OnAwake()
|
|
||||||
{
|
|
||||||
InputCursorExtension.InputInit();
|
|
||||||
DontDestroyOnLoad(gameObject);
|
|
||||||
PlayerInputControl = new PlayerInputControl();
|
|
||||||
PlayerInputControl.Enable();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void Start()
|
|
||||||
{
|
|
||||||
AddEvent();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnDestroy()
|
|
||||||
{
|
|
||||||
RemoveEvent();
|
|
||||||
InputCursorExtension.Dispose();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public static void SetMouseCursor(bool val)
|
|
||||||
{
|
|
||||||
if (val)
|
|
||||||
{
|
|
||||||
if (ControllerType == ControllerType.KeyboardMouse)
|
|
||||||
{
|
|
||||||
Cursor.visible = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
Cursor.lockState = CursorLockMode.None;
|
|
||||||
}
|
|
||||||
else if (ControllerType == ControllerType.KeyboardMouse)
|
|
||||||
{
|
|
||||||
Cursor.visible = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
Cursor.visible = val;
|
|
||||||
if (!val)
|
|
||||||
{
|
|
||||||
Cursor.lockState = CursorLockMode.Confined;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Vector2 GetMovementInput()
|
|
||||||
{
|
|
||||||
if (IsUIStopInput) return Vector2.zero;
|
|
||||||
return PlayerInputControl.Player.Move?.ReadValue<Vector2>() ?? Vector2.zero;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Vector2 GetLookInput()
|
|
||||||
{
|
|
||||||
if (IsUIStopInput) return Vector2.zero;
|
|
||||||
return PlayerInputControl.Player.Look?.ReadValue<Vector2>() ?? Vector2.zero;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private void AddEvent()
|
|
||||||
{
|
|
||||||
foreach (var actionMap in PlayerInputControl.asset.actionMaps)
|
|
||||||
{
|
|
||||||
actionMap.Enable();
|
|
||||||
if (actionMap.name == "UI")
|
|
||||||
{
|
|
||||||
foreach (var action in actionMap.actions)
|
|
||||||
{
|
|
||||||
if (action.type == InputActionType.Button)
|
|
||||||
{
|
|
||||||
action.performed += OnUIButtonPerformed;
|
|
||||||
action.canceled += OnUIButtonCanceled;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (actionMap.name == "Player")
|
|
||||||
{
|
|
||||||
foreach (var action in actionMap.actions)
|
|
||||||
{
|
|
||||||
if (action.type == InputActionType.Button)
|
|
||||||
{
|
|
||||||
action.performed += OnPlayerButtonPerformed;
|
|
||||||
action.canceled += OnPlayerButtonCanceled;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void RemoveEvent()
|
|
||||||
{
|
|
||||||
OnUIPerformed = null;
|
|
||||||
OnUICanceled = null;
|
|
||||||
OnPlayerPerformed = null;
|
|
||||||
OnPlayerCanceled = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnUIButtonPerformed(InputAction.CallbackContext context)
|
|
||||||
{
|
|
||||||
OnUIPerformed?.Invoke(context.action.name);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnUIButtonCanceled(InputAction.CallbackContext context)
|
|
||||||
{
|
|
||||||
OnUICanceled?.Invoke(context.action.name);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnPlayerButtonPerformed(InputAction.CallbackContext context)
|
|
||||||
{
|
|
||||||
if (IsUIStopInput) return;
|
|
||||||
var actionName = context.action.name;
|
|
||||||
if (actionName == "Op1")
|
|
||||||
{
|
|
||||||
OnOp1Action?.Invoke(true);
|
|
||||||
}
|
|
||||||
else if (actionName == "Op2")
|
|
||||||
{
|
|
||||||
OnOp2Action?.Invoke(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
OnPlayerPerformed?.Invoke(actionName);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnPlayerButtonCanceled(InputAction.CallbackContext context)
|
|
||||||
{
|
|
||||||
if (IsUIStopInput) return;
|
|
||||||
var actionName = context.action.name;
|
|
||||||
if (actionName == "Op1")
|
|
||||||
{
|
|
||||||
OnOp1Action?.Invoke(false);
|
|
||||||
}
|
|
||||||
else if (actionName == "Op2")
|
|
||||||
{
|
|
||||||
OnOp2Action?.Invoke(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
OnPlayerCanceled?.Invoke(actionName);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public void OnInteractiveObject(InteractiveObject interactiveObject)
|
|
||||||
{
|
|
||||||
Debug.LogError($"OnInteractiveObject {interactiveObject != null}");
|
|
||||||
OnInteractiveObjectAction?.Invoke(interactiveObject);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void SendUIInput(string actionName)
|
|
||||||
{
|
|
||||||
OnUIPerformed?.Invoke(actionName);
|
|
||||||
OnUICanceled?.Invoke(actionName);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: fecc50928be248b896f6ee0a17e7b76d
|
|
||||||
timeCreated: 1746892722
|
|
||||||
@@ -8,7 +8,7 @@ namespace NBF.Setting
|
|||||||
public override string Group => SettingsDef.Group.Keyboard;
|
public override string Group => SettingsDef.Group.Keyboard;
|
||||||
public override string Tab => SettingsDef.Tab.Keyboard;
|
public override string Tab => SettingsDef.Tab.Keyboard;
|
||||||
|
|
||||||
public override InputAction InputAction => InputManager.PlayerInputControl.Player.AddBob;
|
public override InputAction InputAction => Game.Input.PlayerInputControl.Player.AddBob;
|
||||||
|
|
||||||
protected override void OnApply()
|
protected override void OnApply()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ namespace NBF.Setting
|
|||||||
public override string Group => SettingsDef.Group.Keyboard;
|
public override string Group => SettingsDef.Group.Keyboard;
|
||||||
public override string Tab => SettingsDef.Tab.Keyboard;
|
public override string Tab => SettingsDef.Tab.Keyboard;
|
||||||
|
|
||||||
public override InputAction InputAction => InputManager.PlayerInputControl.Player.Chat;
|
public override InputAction InputAction => Game.Input.PlayerInputControl.Player.Chat;
|
||||||
|
|
||||||
protected override void OnApply()
|
protected override void OnApply()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ namespace NBF.Setting
|
|||||||
public override string Group => SettingsDef.Group.Keyboard;
|
public override string Group => SettingsDef.Group.Keyboard;
|
||||||
public override string Tab => SettingsDef.Tab.Keyboard;
|
public override string Tab => SettingsDef.Tab.Keyboard;
|
||||||
|
|
||||||
public override InputAction InputAction => InputManager.PlayerInputControl.Player.Help;
|
public override InputAction InputAction => Game.Input.PlayerInputControl.Player.Help;
|
||||||
|
|
||||||
protected override void OnApply()
|
protected override void OnApply()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ namespace NBF.Setting
|
|||||||
public override string Group => SettingsDef.Group.Keyboard;
|
public override string Group => SettingsDef.Group.Keyboard;
|
||||||
public override string Tab => SettingsDef.Tab.Keyboard;
|
public override string Tab => SettingsDef.Tab.Keyboard;
|
||||||
|
|
||||||
public override InputAction InputAction => InputManager.PlayerInputControl.Player.SubBob;
|
public override InputAction InputAction => Game.Input.PlayerInputControl.Player.SubBob;
|
||||||
|
|
||||||
protected override void OnApply()
|
protected override void OnApply()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ namespace NBF.Setting
|
|||||||
public override string Group => SettingsDef.Group.Keyboard;
|
public override string Group => SettingsDef.Group.Keyboard;
|
||||||
public override string Tab => SettingsDef.Tab.Keyboard;
|
public override string Tab => SettingsDef.Tab.Keyboard;
|
||||||
|
|
||||||
public override InputAction InputAction => InputManager.PlayerInputControl.Player.ToBag;
|
public override InputAction InputAction => Game.Input.PlayerInputControl.Player.ToBag;
|
||||||
|
|
||||||
protected override void OnApply()
|
protected override void OnApply()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ namespace NBF.Setting
|
|||||||
public override string Group => SettingsDef.Group.Keyboard;
|
public override string Group => SettingsDef.Group.Keyboard;
|
||||||
public override string Tab => SettingsDef.Tab.Keyboard;
|
public override string Tab => SettingsDef.Tab.Keyboard;
|
||||||
|
|
||||||
public override InputAction InputAction => InputManager.PlayerInputControl.Player.UseTelescope;
|
public override InputAction InputAction => Game.Input.PlayerInputControl.Player.UseTelescope;
|
||||||
|
|
||||||
protected override void OnApply()
|
protected override void OnApply()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ namespace NBF.Setting
|
|||||||
public override string Group => SettingsDef.Group.Keyboard;
|
public override string Group => SettingsDef.Group.Keyboard;
|
||||||
public override string Tab => SettingsDef.Tab.Keyboard;
|
public override string Tab => SettingsDef.Tab.Keyboard;
|
||||||
|
|
||||||
public override InputAction InputAction => InputManager.PlayerInputControl.Player.UseTorch;
|
public override InputAction InputAction => Game.Input.PlayerInputControl.Player.UseTorch;
|
||||||
|
|
||||||
protected override void OnApply()
|
protected override void OnApply()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ namespace NBF
|
|||||||
Log.Debug($"登录到Gate服务器成功!ErrorCode:{loginResponse.ErrorCode}");
|
Log.Debug($"登录到Gate服务器成功!ErrorCode:{loginResponse.ErrorCode}");
|
||||||
await role.GetRoleInfo();
|
await role.GetRoleInfo();
|
||||||
Log.Debug(
|
Log.Debug(
|
||||||
$"获取角色信息成功!roleId={role.Id} Room={role.RoomId} RoleInfo={JsonConvert.SerializeObject(role.Info)}");
|
$"获取角色信息成功!roleId={role.Id} Room={role.RoomCode} RoleInfo={JsonConvert.SerializeObject(role.Info)}");
|
||||||
var mapId = role.Info.MapId;
|
var mapId = role.Info.MapId;
|
||||||
if (mapId == 0)
|
if (mapId == 0)
|
||||||
{
|
{
|
||||||
@@ -70,7 +70,8 @@ namespace NBF
|
|||||||
mapId = 99;
|
mapId = 99;
|
||||||
}
|
}
|
||||||
|
|
||||||
await MapHelper.EnterMap(mapId, role.RoomId);
|
Game.SelfId = loginResponse.RoleId;
|
||||||
|
await MapHelper.EnterMap(mapId, role.RoomCode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -17,7 +17,7 @@ namespace NBF.Fishing2
|
|||||||
var input = scene.AddComponent<InputComponent>();
|
var input = scene.AddComponent<InputComponent>();
|
||||||
scene.AddComponent<SettingComponent>();
|
scene.AddComponent<SettingComponent>();
|
||||||
|
|
||||||
Global.Input = input;
|
Game.Input = input;
|
||||||
}
|
}
|
||||||
|
|
||||||
await FTask.CompletedTask;
|
await FTask.CompletedTask;
|
||||||
|
|||||||
@@ -49,7 +49,8 @@ namespace NBF
|
|||||||
{
|
{
|
||||||
// if (!SRDebug.Instance.IsDebugPanelVisible && !SRDebug.Instance.IsDebugPanelVisible)
|
// if (!SRDebug.Instance.IsDebugPanelVisible && !SRDebug.Instance.IsDebugPanelVisible)
|
||||||
{
|
{
|
||||||
var lookInput = InputManager.GetLookInput();
|
// var lookInput = InputManager.GetLookInput();
|
||||||
|
var lookInput = Vector2.zero;
|
||||||
|
|
||||||
float num = Mathf.Clamp(lookInput.y * YSensitivity * 5f * Time.deltaTime, -10f, 10f);
|
float num = Mathf.Clamp(lookInput.y * YSensitivity * 5f * Time.deltaTime, -10f, 10f);
|
||||||
float num2 =
|
float num2 =
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ namespace NBF
|
|||||||
|
|
||||||
protected override void OnShow()
|
protected override void OnShow()
|
||||||
{
|
{
|
||||||
InputManager.OnUICanceled += OnUICanceled;
|
Game.Input.OnUICanceled += OnUICanceled;
|
||||||
UseBottomMenu();
|
UseBottomMenu();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -49,7 +49,7 @@ namespace NBF
|
|||||||
|
|
||||||
protected override void OnHide()
|
protected override void OnHide()
|
||||||
{
|
{
|
||||||
InputManager.OnUICanceled -= OnUICanceled;
|
Game.Input.OnUICanceled -= OnUICanceled;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnDestroy()
|
protected override void OnDestroy()
|
||||||
|
|||||||
@@ -18,12 +18,12 @@ namespace NBF
|
|||||||
|
|
||||||
private void OnInited()
|
private void OnInited()
|
||||||
{
|
{
|
||||||
InputManager.OnUICanceled += OnUICanceled;
|
Game.Input.OnUICanceled += OnUICanceled;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Dispose()
|
public override void Dispose()
|
||||||
{
|
{
|
||||||
InputManager.OnUICanceled -= OnUICanceled;
|
Game.Input.OnUICanceled -= OnUICanceled;
|
||||||
base.Dispose();
|
base.Dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ namespace NBF
|
|||||||
{
|
{
|
||||||
var item = context.data as BtnTitleInputControl;
|
var item = context.data as BtnTitleInputControl;
|
||||||
if (item == null) return;
|
if (item == null) return;
|
||||||
InputManager.Instance.SendUIInput(item.ActionName);
|
Game.Input.SendUIInput(item.ActionName);
|
||||||
Debug.Log("模拟点击===");
|
Debug.Log("模拟点击===");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,12 +18,12 @@ namespace NBF
|
|||||||
BtnPrev.onClick.Add(OnClickBtnPrev);
|
BtnPrev.onClick.Add(OnClickBtnPrev);
|
||||||
BtnNext.onClick.Add(OnClickBtnNext);
|
BtnNext.onClick.Add(OnClickBtnNext);
|
||||||
|
|
||||||
InputManager.OnUICanceled += OnUICanceled;
|
Game.Input.OnUICanceled += OnUICanceled;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Dispose()
|
public override void Dispose()
|
||||||
{
|
{
|
||||||
InputManager.OnUICanceled -= OnUICanceled;
|
Game.Input.OnUICanceled -= OnUICanceled;
|
||||||
base.Dispose();
|
base.Dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,12 +18,12 @@ namespace NBF
|
|||||||
BtnPrev.onClick.Add(OnClickBtnPrev);
|
BtnPrev.onClick.Add(OnClickBtnPrev);
|
||||||
BtnNext.onClick.Add(OnClickBtnNext);
|
BtnNext.onClick.Add(OnClickBtnNext);
|
||||||
|
|
||||||
InputManager.OnUICanceled += OnUICanceled;
|
Game.Input.OnUICanceled += OnUICanceled;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Dispose()
|
public override void Dispose()
|
||||||
{
|
{
|
||||||
InputManager.OnUICanceled -= OnUICanceled;
|
Game.Input.OnUICanceled -= OnUICanceled;
|
||||||
base.Dispose();
|
base.Dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ namespace NBF
|
|||||||
|
|
||||||
protected override void OnShow()
|
protected override void OnShow()
|
||||||
{
|
{
|
||||||
InputManager.OnUICanceled += OnUICanceled;
|
Game.Input.OnUICanceled += OnUICanceled;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnUICanceled(string action)
|
private void OnUICanceled(string action)
|
||||||
@@ -37,7 +37,7 @@ namespace NBF
|
|||||||
|
|
||||||
protected override void OnHide()
|
protected override void OnHide()
|
||||||
{
|
{
|
||||||
InputManager.OnUICanceled -= OnUICanceled;
|
Game.Input.OnUICanceled -= OnUICanceled;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnDestroy()
|
protected override void OnDestroy()
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ namespace NBF
|
|||||||
HideAnim = this.HideCenterScaleBig;
|
HideAnim = this.HideCenterScaleBig;
|
||||||
IsModal = true;
|
IsModal = true;
|
||||||
IsDontBack = true;
|
IsDontBack = true;
|
||||||
InputManager.OnUICanceled += OnUICanceled;
|
Game.Input.OnUICanceled += OnUICanceled;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnShow()
|
protected override void OnShow()
|
||||||
@@ -80,7 +80,7 @@ namespace NBF
|
|||||||
protected override void OnDestroy()
|
protected override void OnDestroy()
|
||||||
{
|
{
|
||||||
base.OnDestroy();
|
base.OnDestroy();
|
||||||
InputManager.OnUICanceled -= OnUICanceled;
|
Game.Input.OnUICanceled -= OnUICanceled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -16,9 +16,9 @@ namespace NBF
|
|||||||
|
|
||||||
protected override void OnShow()
|
protected override void OnShow()
|
||||||
{
|
{
|
||||||
InputManager.OnUICanceled += OnUICanceled;
|
Game.Input.OnUICanceled += OnUICanceled;
|
||||||
InputManager.OnInteractiveObjectAction += OnInteractiveObjectAction;
|
Game.Input.OnInteractiveObjectAction += OnInteractiveObjectAction;
|
||||||
InputManager.OnPlayerCanceled += OnPlayerCanceled;
|
Game.Input.OnPlayerCanceled += OnPlayerCanceled;
|
||||||
// InputManager.OnUseAction += OnUseAction;
|
// InputManager.OnUseAction += OnUseAction;
|
||||||
// InputManager.OnUse2Action += OnUse2Action;
|
// InputManager.OnUse2Action += OnUse2Action;
|
||||||
}
|
}
|
||||||
@@ -70,9 +70,9 @@ namespace NBF
|
|||||||
protected override void OnHide()
|
protected override void OnHide()
|
||||||
{
|
{
|
||||||
base.OnHide();
|
base.OnHide();
|
||||||
InputManager.OnUICanceled -= OnUICanceled;
|
Game.Input.OnUICanceled -= OnUICanceled;
|
||||||
InputManager.OnInteractiveObjectAction -= OnInteractiveObjectAction;
|
Game.Input.OnInteractiveObjectAction -= OnInteractiveObjectAction;
|
||||||
InputManager.OnUICanceled -= OnPlayerCanceled;
|
Game.Input.OnUICanceled -= OnPlayerCanceled;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -29,7 +29,7 @@ namespace NBF
|
|||||||
|
|
||||||
protected override void OnShow()
|
protected override void OnShow()
|
||||||
{
|
{
|
||||||
InputManager.OnUICanceled += OnUICanceled;
|
Game.Input.OnUICanceled += OnUICanceled;
|
||||||
UseBottomMenu();
|
UseBottomMenu();
|
||||||
|
|
||||||
|
|
||||||
@@ -40,7 +40,7 @@ namespace NBF
|
|||||||
|
|
||||||
protected override void OnHide()
|
protected override void OnHide()
|
||||||
{
|
{
|
||||||
InputManager.OnUICanceled -= OnUICanceled;
|
Game.Input.OnUICanceled -= OnUICanceled;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnUICanceled(string action)
|
private void OnUICanceled(string action)
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ using UnityEngine;
|
|||||||
using NBC;
|
using NBC;
|
||||||
using NBC.Entitas;
|
using NBC.Entitas;
|
||||||
using NBF.Fishing2;
|
using NBF.Fishing2;
|
||||||
|
using UnityEngine.InputSystem;
|
||||||
using UIPanel = NBC.UIPanel;
|
using UIPanel = NBC.UIPanel;
|
||||||
|
|
||||||
namespace NBF
|
namespace NBF
|
||||||
@@ -14,6 +15,54 @@ namespace NBF
|
|||||||
protected override void OnInit()
|
protected override void OnInit()
|
||||||
{
|
{
|
||||||
this.AutoAddClick(OnClick);
|
this.AutoAddClick(OnClick);
|
||||||
|
|
||||||
|
Game.Input.OnPlayerPerformed += OnPlayerCanceled;
|
||||||
|
Game.Input.OnPlayerPerformed += OnPlayerPerformed;
|
||||||
|
|
||||||
|
Game.Input.OnPlayerValueCanceled += OnPlayerValueCanceled;
|
||||||
|
Game.Input.OnPlayerValuePerformed += OnPlayerValuePerformed;
|
||||||
|
}
|
||||||
|
|
||||||
|
private bool _isRun;
|
||||||
|
|
||||||
|
private void OnPlayerPerformed(string action)
|
||||||
|
{
|
||||||
|
if (action == "Run")
|
||||||
|
{
|
||||||
|
_isRun = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
Log.Info($"OnPlayerPerformed action = {action}");
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnPlayerCanceled(string action)
|
||||||
|
{
|
||||||
|
if (action == "Run")
|
||||||
|
{
|
||||||
|
_isRun = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
Log.Info($"OnPlayerCanceled action = {action}");
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnPlayerValueCanceled(InputAction.CallbackContext context)
|
||||||
|
{
|
||||||
|
var name = context.action.name;
|
||||||
|
if (name == "Move")
|
||||||
|
{
|
||||||
|
var v2 = context.ReadValue<Vector2>();
|
||||||
|
Log.Info($"OnPlayerValueCanceled name={name} v2={v2}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnPlayerValuePerformed(InputAction.CallbackContext context)
|
||||||
|
{
|
||||||
|
var name = context.action.name;
|
||||||
|
if (name == "Move")
|
||||||
|
{
|
||||||
|
var v2 = context.ReadValue<Vector2>();
|
||||||
|
Log.Info($"OnPlayerValuePerformed name={name} v2={v2}");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnClick(GComponent btn)
|
private void OnClick(GComponent btn)
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ namespace NBF
|
|||||||
protected override void OnShow()
|
protected override void OnShow()
|
||||||
{
|
{
|
||||||
Settings.Instance.LoadAllSettings();
|
Settings.Instance.LoadAllSettings();
|
||||||
InputManager.OnUICanceled += OnUICanceled;
|
Game.Input.OnUICanceled += OnUICanceled;
|
||||||
Menu.SetTabs(tabList);
|
Menu.SetTabs(tabList);
|
||||||
UseBottomMenu();
|
UseBottomMenu();
|
||||||
}
|
}
|
||||||
@@ -271,7 +271,7 @@ namespace NBF
|
|||||||
protected override void OnHide()
|
protected override void OnHide()
|
||||||
{
|
{
|
||||||
base.OnHide();
|
base.OnHide();
|
||||||
InputManager.OnUICanceled -= OnUICanceled;
|
Game.Input.OnUICanceled -= OnUICanceled;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnDestroy()
|
protected override void OnDestroy()
|
||||||
|
|||||||
@@ -53,6 +53,7 @@ MonoBehaviour:
|
|||||||
m_AdditionalLightsShadowResolutionTierHigh: 1024
|
m_AdditionalLightsShadowResolutionTierHigh: 1024
|
||||||
m_ReflectionProbeBlending: 1
|
m_ReflectionProbeBlending: 1
|
||||||
m_ReflectionProbeBoxProjection: 1
|
m_ReflectionProbeBoxProjection: 1
|
||||||
|
m_ReflectionProbeAtlas: 1
|
||||||
m_ShadowDistance: 150
|
m_ShadowDistance: 150
|
||||||
m_ShadowCascadeCount: 4
|
m_ShadowCascadeCount: 4
|
||||||
m_Cascade2Split: 0.25
|
m_Cascade2Split: 0.25
|
||||||
@@ -129,6 +130,10 @@ MonoBehaviour:
|
|||||||
m_PrefilterScreenCoord: 1
|
m_PrefilterScreenCoord: 1
|
||||||
m_PrefilterNativeRenderPass: 1
|
m_PrefilterNativeRenderPass: 1
|
||||||
m_PrefilterUseLegacyLightmaps: 0
|
m_PrefilterUseLegacyLightmaps: 0
|
||||||
|
m_PrefilterBicubicLightmapSampling: 1
|
||||||
|
m_PrefilterReflectionProbeBlending: 0
|
||||||
|
m_PrefilterReflectionProbeBoxProjection: 0
|
||||||
|
m_PrefilterReflectionProbeAtlas: 0
|
||||||
m_ShaderVariantLogLevel: 0
|
m_ShaderVariantLogLevel: 0
|
||||||
m_ShadowCascades: 0
|
m_ShadowCascades: 0
|
||||||
m_Textures:
|
m_Textures:
|
||||||
|
|||||||
@@ -63,7 +63,21 @@ MonoBehaviour:
|
|||||||
- rid: 6565977368940511236
|
- rid: 6565977368940511236
|
||||||
- rid: 6565977368940511237
|
- rid: 6565977368940511237
|
||||||
m_RuntimeSettings:
|
m_RuntimeSettings:
|
||||||
m_List: []
|
m_List:
|
||||||
|
- rid: 6852985685364965378
|
||||||
|
- rid: 6852985685364965379
|
||||||
|
- rid: 6852985685364965380
|
||||||
|
- rid: 6852985685364965381
|
||||||
|
- rid: 6852985685364965384
|
||||||
|
- rid: 6852985685364965385
|
||||||
|
- rid: 6852985685364965392
|
||||||
|
- rid: 6852985685364965394
|
||||||
|
- rid: 8712630790384254976
|
||||||
|
- rid: 7166519162571063296
|
||||||
|
- rid: 7166519162571063298
|
||||||
|
- rid: 7166519162571063301
|
||||||
|
- rid: 6565977368940511236
|
||||||
|
- rid: 6565977368940511237
|
||||||
m_AssetVersion: 8
|
m_AssetVersion: 8
|
||||||
m_ObsoleteDefaultVolumeProfile: {fileID: 0}
|
m_ObsoleteDefaultVolumeProfile: {fileID: 0}
|
||||||
m_RenderingLayerNames:
|
m_RenderingLayerNames:
|
||||||
|
|||||||
@@ -281,7 +281,7 @@ Texture2D:
|
|||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
Hash: 00000000000000000000000000000000
|
Hash: 00000000000000000000000000000000
|
||||||
m_IsAlphaChannelOptional: 0
|
m_IsAlphaChannelOptional: 0
|
||||||
serializedVersion: 3
|
serializedVersion: 4
|
||||||
m_Width: 1
|
m_Width: 1
|
||||||
m_Height: 1
|
m_Height: 1
|
||||||
m_CompleteImageSize: 1
|
m_CompleteImageSize: 1
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ABindingFlags_002Ecs_002Fl_003AC_0021_003FUsers_003Fbob_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F5a41d6b7189842eca409fd0b1c3e3dcf17bf78_003Fa8_003F57a4f791_003FBindingFlags_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ABindingFlags_002Ecs_002Fl_003AC_0021_003FUsers_003Fbob_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F5a41d6b7189842eca409fd0b1c3e3dcf17bf78_003Fa8_003F57a4f791_003FBindingFlags_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ABindingFlags_002Ecs_002Fl_003AC_0021_003FUsers_003Fbob_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F9c2967a135e648bdb993c5397a44991b573620_003F94_003F16186629_003FBindingFlags_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ABindingFlags_002Ecs_002Fl_003AC_0021_003FUsers_003Fbob_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F9c2967a135e648bdb993c5397a44991b573620_003F94_003F16186629_003FBindingFlags_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ACollider_002Ecs_002Fl_003AC_0021_003FUsers_003F60527_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F03ef825315384b1cab81c4b53eb03d922ac00_003Fd1_003Fa6f13559_003FCollider_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ACollider_002Ecs_002Fl_003AC_0021_003FUsers_003F60527_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F03ef825315384b1cab81c4b53eb03d922ac00_003Fd1_003Fa6f13559_003FCollider_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||||
|
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AComponent_002Ecs_002Fl_003AC_0021_003FUsers_003F60527_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fb4c8c45fec274213bfac03ee0e9a3d621f5a00_003F7b_003F4d79464b_003FComponent_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ACursor_002Ecs_002Fl_003AC_0021_003FUsers_003F60527_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F021f30a9a92b48ce98ae6b39956dd76a1df600_003Fd0_003F709b15ec_003FCursor_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ACursor_002Ecs_002Fl_003AC_0021_003FUsers_003F60527_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F021f30a9a92b48ce98ae6b39956dd76a1df600_003Fd0_003F709b15ec_003FCursor_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ADictionary_00602_002Ecs_002Fl_003AC_0021_003FUsers_003F60527_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F3789ee403a53437cbb6b5d9ab6311f51573620_003Fe4_003F91da590a_003FDictionary_00602_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ADictionary_00602_002Ecs_002Fl_003AC_0021_003FUsers_003F60527_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F3789ee403a53437cbb6b5d9ab6311f51573620_003Fe4_003F91da590a_003FDictionary_00602_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AExceptionDispatchInfo_002Ecs_002Fl_003AC_0021_003FUsers_003F60527_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F314938d17f3848e8ac683e11b27f62ee46ae00_003F70_003F17d560d4_003FExceptionDispatchInfo_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AExceptionDispatchInfo_002Ecs_002Fl_003AC_0021_003FUsers_003F60527_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F314938d17f3848e8ac683e11b27f62ee46ae00_003F70_003F17d560d4_003FExceptionDispatchInfo_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ PlayerSettings:
|
|||||||
xboxEnableFitness: 0
|
xboxEnableFitness: 0
|
||||||
visibleInBackground: 1
|
visibleInBackground: 1
|
||||||
allowFullscreenSwitch: 1
|
allowFullscreenSwitch: 1
|
||||||
fullscreenMode: 1
|
fullscreenMode: 3
|
||||||
xboxSpeechDB: 0
|
xboxSpeechDB: 0
|
||||||
xboxEnableHeadOrientation: 0
|
xboxEnableHeadOrientation: 0
|
||||||
xboxEnableGuest: 0
|
xboxEnableGuest: 0
|
||||||
@@ -142,7 +142,8 @@ PlayerSettings:
|
|||||||
visionOSBundleVersion: 1.0
|
visionOSBundleVersion: 1.0
|
||||||
tvOSBundleVersion: 1.0
|
tvOSBundleVersion: 1.0
|
||||||
bundleVersion: 0.1.0
|
bundleVersion: 0.1.0
|
||||||
preloadedAssets: []
|
preloadedAssets:
|
||||||
|
- {fileID: -944628639613478452, guid: 8a314d59348c97b4e96e6eb9b09285a6, type: 3}
|
||||||
metroInputSource: 0
|
metroInputSource: 0
|
||||||
wsaTransparentSwapchain: 0
|
wsaTransparentSwapchain: 0
|
||||||
m_HolographicPauseOnTrackingLoss: 1
|
m_HolographicPauseOnTrackingLoss: 1
|
||||||
@@ -520,7 +521,10 @@ PlayerSettings:
|
|||||||
m_Height: 720
|
m_Height: 720
|
||||||
m_Kind: 1
|
m_Kind: 1
|
||||||
m_SubKind:
|
m_SubKind:
|
||||||
m_BuildTargetBatching: []
|
m_BuildTargetBatching:
|
||||||
|
- m_BuildTarget: Standalone
|
||||||
|
m_StaticBatching: 1
|
||||||
|
m_DynamicBatching: 0
|
||||||
m_BuildTargetShaderSettings: []
|
m_BuildTargetShaderSettings: []
|
||||||
m_BuildTargetGraphicsJobs: []
|
m_BuildTargetGraphicsJobs: []
|
||||||
m_BuildTargetGraphicsJobMode: []
|
m_BuildTargetGraphicsJobMode: []
|
||||||
|
|||||||
Reference in New Issue
Block a user