属性控制
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -503,7 +503,7 @@ Transform:
|
||||
m_GameObject: {fileID: 542608892086238647}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalPosition: {x: 0, y: 2, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
|
||||
@@ -3253,7 +3253,7 @@ GameObject:
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
m_IsActive: 0
|
||||
--- !u!4 &4424852676135480966
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -4155,7 +4155,7 @@ GameObject:
|
||||
- component: {fileID: 4304401782308419094}
|
||||
- component: {fileID: 6041496193769315420}
|
||||
- component: {fileID: 5826410683169617913}
|
||||
- component: {fileID: 6556378698144161009}
|
||||
- component: {fileID: 8415514457689978090}
|
||||
m_Layer: 9
|
||||
m_Name: male
|
||||
m_TagString: Untagged
|
||||
@@ -4538,7 +4538,7 @@ CharacterController:
|
||||
m_SkinWidth: 0.08
|
||||
m_MinMoveDistance: 0.001
|
||||
m_Center: {x: 0, y: 0.82, z: 0}
|
||||
--- !u!114 &6556378698144161009
|
||||
--- !u!114 &8415514457689978090
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
@@ -4547,10 +4547,11 @@ MonoBehaviour:
|
||||
m_GameObject: {fileID: 5559475303044247694}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: cddbe2f2da274f6196485f744b618c86, type: 3}
|
||||
m_Script: {fileID: 11500000, guid: 553e656eacf648afb33751a88352d216, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: Assembly-CSharp::NBF.PlayerAnimator
|
||||
animator: {fileID: 523589534089097102}
|
||||
m_EditorClassIdentifier: Assembly-CSharp::NBF.PlayerAsset
|
||||
FPSCamera: {fileID: 5273066534610348271}
|
||||
FishingLight: {fileID: 4423234379613481388}
|
||||
--- !u!1 &5735120231836046354
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
||||
@@ -51,6 +51,7 @@ namespace NBF
|
||||
|
||||
public const string Move = "Move";
|
||||
public const string Look = "Look";
|
||||
public const string UseTorch = "UseTorch";
|
||||
}
|
||||
|
||||
#region Load Icon
|
||||
|
||||
3
Assets/Scripts/Fishing2/Message.meta
Normal file
3
Assets/Scripts/Fishing2/Message.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b35630cbcbbb4792a821de847fabbd69
|
||||
timeCreated: 1757820526
|
||||
3
Assets/Scripts/Fishing2/Message/Event.meta
Normal file
3
Assets/Scripts/Fishing2/Message/Event.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c197c410c838437996d832515a62026e
|
||||
timeCreated: 1757835465
|
||||
35
Assets/Scripts/Fishing2/Message/Event/NumericChangeEvent.cs
Normal file
35
Assets/Scripts/Fishing2/Message/Event/NumericChangeEvent.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
using System.Collections.Generic;
|
||||
using NBC;
|
||||
using NBC.Event;
|
||||
using NBC.Helper;
|
||||
|
||||
namespace NBF.Fishing2
|
||||
{
|
||||
public class NumericChangeEvent : EventSystem<NumericChange>
|
||||
{
|
||||
protected override void Handler(NumericChange self)
|
||||
{
|
||||
if (self.NumericType == NumericType.Flashlight)
|
||||
{
|
||||
var flashlight = self.MapUnit.GetComponent<FlashlightComponent>();
|
||||
flashlight.Change(self.New);
|
||||
if (self.MapUnit.IsSelf())
|
||||
{
|
||||
var list = new List<KeyValueInt64>
|
||||
{
|
||||
new KeyValueInt64()
|
||||
{
|
||||
Key = self.NumericType,
|
||||
Value = self.New
|
||||
}
|
||||
};
|
||||
//如果是自己的,则同步给其他玩家
|
||||
Net.Send(new C2Map_RolePropertyChange()
|
||||
{
|
||||
Propertys = list
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2dae2fd757bc46b7b47a7b548b36ed54
|
||||
timeCreated: 1757835696
|
||||
@@ -0,0 +1,22 @@
|
||||
using NBC;
|
||||
using NBC.Network;
|
||||
using NBC.Network.Interface;
|
||||
|
||||
namespace NBF.Fishing2
|
||||
{
|
||||
public class Map2C_RolePropertyChangeNotifyHandler : Message<Map2C_RolePropertyChangeNotify>
|
||||
{
|
||||
protected override async FTask Run(Session session, Map2C_RolePropertyChangeNotify message)
|
||||
{
|
||||
var map = App.Main.GetComponent<Map>();
|
||||
var unit = map.Units[message.Id];
|
||||
var numericComponent = unit.GetComponent<NumericComponent>();
|
||||
foreach (var property in message.Propertys)
|
||||
{
|
||||
numericComponent.Set(property.Key, property.Value);
|
||||
}
|
||||
|
||||
await FTask.CompletedTask;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b507863390534ecca584e3a787180493
|
||||
timeCreated: 1757820797
|
||||
@@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cddbe2f2da274f6196485f744b618c86
|
||||
timeCreated: 1756820608
|
||||
@@ -1,41 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using NBC;
|
||||
using NBC.Entitas;
|
||||
using NBC.Entitas.Interface;
|
||||
using UnityEngine;
|
||||
using UnityEngine.InputSystem;
|
||||
|
||||
namespace NBF.Fishing2
|
||||
{
|
||||
[System.Serializable]
|
||||
public struct MoveState
|
||||
{
|
||||
public Vector3 startPosition; // 开始移动时的位置
|
||||
public Vector3 moveDirection; // 移动方向(标准化向量)
|
||||
public float moveSpeed; // 移动速度
|
||||
public bool isMoving; // 是否正在移动
|
||||
public double serverTimestamp; // 服务器时间戳
|
||||
}
|
||||
|
||||
public class MoveComponent : Entity
|
||||
{
|
||||
public bool Run;
|
||||
|
||||
public readonly Queue<MoveState> MoveStateQueue = new Queue<MoveState>();
|
||||
|
||||
#region System
|
||||
|
||||
public class MoveComponentDestroySystem : DestroySystem<MoveComponent>
|
||||
{
|
||||
protected override void Destroy(MoveComponent self)
|
||||
{
|
||||
|
||||
self.Run = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 660d750ed1f74128a55bbb574d772af4
|
||||
timeCreated: 1756115969
|
||||
@@ -1,14 +0,0 @@
|
||||
using NBC;
|
||||
using UnityEngine;
|
||||
|
||||
namespace NBF.Fishing2
|
||||
{
|
||||
public struct MoveChange
|
||||
{
|
||||
public MapUnit Unit;
|
||||
public Vector3 Position;
|
||||
public Quaternion Rotation;
|
||||
public Vector2Info Direction;
|
||||
public bool IsStop;
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2b438b0d299c4b7186d21faf5de07cca
|
||||
timeCreated: 1756882697
|
||||
3
Assets/Scripts/Fishing2/Unit/Equipment.meta
Normal file
3
Assets/Scripts/Fishing2/Unit/Equipment.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 35bf130c632b4a31b064a6d0706aba65
|
||||
timeCreated: 1757835845
|
||||
@@ -0,0 +1,66 @@
|
||||
using NBC.Entitas;
|
||||
using NBC.Entitas.Interface;
|
||||
using UnityEngine;
|
||||
|
||||
namespace NBF.Fishing2
|
||||
{
|
||||
/// <summary>
|
||||
/// 手电筒组件
|
||||
/// </summary>
|
||||
public class FlashlightComponent : Entity
|
||||
{
|
||||
private GameObject _fishingLight;
|
||||
|
||||
|
||||
public class FlashlightComponentAwakeSystem : AwakeSystem<FlashlightComponent>
|
||||
{
|
||||
protected override void Awake(FlashlightComponent self)
|
||||
{
|
||||
var numericComponent = self.Parent.GetComponent<NumericComponent>();
|
||||
var unityComponent = self.Parent.GetComponent<UnitUnityComponent>();
|
||||
self._fishingLight = unityComponent.Asset.FishingLight;
|
||||
self.Change(numericComponent[NumericType.Flashlight]);
|
||||
|
||||
var mapUnit = self.Parent as MapUnit;
|
||||
if (mapUnit.IsSelf())
|
||||
{
|
||||
var inputComponent = self.Scene.GetComponent<InputComponent>();
|
||||
inputComponent.OnPlayerPerformed += self.OnPlayerCanceled;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class FlashlightComponentDestroySystem : DestroySystem<FlashlightComponent>
|
||||
{
|
||||
protected override void Destroy(FlashlightComponent self)
|
||||
{
|
||||
self._fishingLight = null;
|
||||
var mapUnit = self.Parent as MapUnit;
|
||||
if (mapUnit.IsSelf())
|
||||
{
|
||||
var inputComponent = self.Scene.GetComponent<InputComponent>();
|
||||
inputComponent.OnPlayerPerformed -= self.OnPlayerCanceled;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void OnPlayerCanceled(string action)
|
||||
{
|
||||
if (action == InputDef.Player.UseTorch)
|
||||
{
|
||||
var numericComponent = Parent.GetComponent<NumericComponent>();
|
||||
if (numericComponent != null)
|
||||
{
|
||||
var oldValue = numericComponent[NumericType.Flashlight];
|
||||
numericComponent[NumericType.Flashlight] = oldValue > 0 ? 0 : 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void Change(long value)
|
||||
{
|
||||
_fishingLight.SetActive(value > 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b498c6d3db5b4d44a1dc99b547416d59
|
||||
timeCreated: 1757836076
|
||||
@@ -54,7 +54,6 @@ namespace NBF.Fishing2
|
||||
|
||||
public void SetUnitInfo(MapUnitInfo unitInfo)
|
||||
{
|
||||
GetOrAddComponent<MoveComponent>();
|
||||
GetOrAddComponent<ObjectWait>();
|
||||
var unitBasic = GetOrAddComponent<MapUnitBasic>();
|
||||
unitBasic.UpdateInfo(unitInfo);
|
||||
|
||||
3
Assets/Scripts/Fishing2/Unit/Move.meta
Normal file
3
Assets/Scripts/Fishing2/Unit/Move.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 309507c5427f4a95bb64f526ce60ded0
|
||||
timeCreated: 1757820516
|
||||
@@ -8,6 +8,16 @@ using UnityEngine.InputSystem;
|
||||
|
||||
namespace NBF.Fishing2
|
||||
{
|
||||
[System.Serializable]
|
||||
public struct MoveState
|
||||
{
|
||||
public Vector3 startPosition; // 开始移动时的位置
|
||||
public Vector3 moveDirection; // 移动方向(标准化向量)
|
||||
public float moveSpeed; // 移动速度
|
||||
public bool isMoving; // 是否正在移动
|
||||
public double serverTimestamp; // 服务器时间戳
|
||||
}
|
||||
|
||||
public class CharacterControllerComponent : Entity
|
||||
{
|
||||
public bool IsSelf;
|
||||
@@ -1,33 +0,0 @@
|
||||
namespace NBF.Fishing2
|
||||
{
|
||||
public class UnitStateArgsFactory
|
||||
{
|
||||
public static UnitStateArgs Create(MapUnit mapUnit, string[] args)
|
||||
{
|
||||
UnitStateArgs ret = null;
|
||||
// return new UnitStateArgs()
|
||||
// {
|
||||
//
|
||||
// }
|
||||
if (ret != null)
|
||||
{
|
||||
ret.SetArgs(args);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
public abstract class UnitStateArgs
|
||||
{
|
||||
protected string[] Args;
|
||||
|
||||
public void SetArgs(string[] args)
|
||||
{
|
||||
Args = args;
|
||||
OnParseArgs();
|
||||
}
|
||||
|
||||
public abstract void OnParseArgs();
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6afa60e6892f49d0aed14024432ab10d
|
||||
timeCreated: 1755917036
|
||||
@@ -1,12 +0,0 @@
|
||||
using NBC.Entitas;
|
||||
|
||||
namespace NBF.Fishing2
|
||||
{
|
||||
/// <summary>
|
||||
/// Unit 对应的 HUD对象
|
||||
/// </summary>
|
||||
public class UnitHUDComponent : Entity
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7b8cd51029604d83a328fd19b8b80d53
|
||||
timeCreated: 1755921088
|
||||
@@ -15,18 +15,15 @@ namespace NBF.Fishing2
|
||||
|
||||
public Transform Transform { get; set; }
|
||||
|
||||
public Animator Animator { get; set; }
|
||||
public LookAtIK LookAtIK { get; set; }
|
||||
public PlayerAsset Asset { get; set; }
|
||||
|
||||
public async FTask InitUnityObject()
|
||||
{
|
||||
var gameObject = PrefabsHelper.CreatePlayer(SceneSettings.Instance.Node);
|
||||
GameObject = gameObject;
|
||||
Transform = gameObject.transform;
|
||||
Animator = gameObject.GetComponent<Animator>();
|
||||
LookAtIK = gameObject.GetComponent<LookAtIK>();
|
||||
Parent.AddComponent<CharacterControllerComponent>();
|
||||
LookAtIK.enabled = false;
|
||||
Asset = gameObject.GetComponent<PlayerAsset>();
|
||||
Parent.AddComponent<FlashlightComponent>();
|
||||
}
|
||||
|
||||
|
||||
@@ -39,21 +36,10 @@ namespace NBF.Fishing2
|
||||
Object.Destroy(self.GameObject);
|
||||
}
|
||||
|
||||
self.Animator = null;
|
||||
self.Asset = null;
|
||||
self.GameObject = null;
|
||||
self.Transform = null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// public static void InitGameObject(this UnitUnityComponent self)
|
||||
// {
|
||||
// var unit = self.Parent as MapUnit;
|
||||
// var prefab = PrefabsHelper.CreatePlayer(SceneSettings.Instance.Node);
|
||||
//
|
||||
// self.GameObject = prefab;
|
||||
// self.Transform = prefab.transform;
|
||||
// self.Animator = prefab.GetComponent<Animator>();
|
||||
// }
|
||||
}
|
||||
}
|
||||
@@ -48,46 +48,6 @@ namespace NBC
|
||||
public VipInfo VipInfo { get; set; }
|
||||
}
|
||||
[ProtoContract]
|
||||
public partial class KeyValueStringInt64 : AMessage, IProto
|
||||
{
|
||||
public static KeyValueStringInt64 Create(Scene scene)
|
||||
{
|
||||
return scene.MessagePoolComponent.Rent<KeyValueStringInt64>();
|
||||
}
|
||||
public override void Dispose()
|
||||
{
|
||||
Key = default;
|
||||
Value = default;
|
||||
#if FANTASY_NET || FANTASY_UNITY
|
||||
GetScene().MessagePoolComponent.Return<KeyValueStringInt64>(this);
|
||||
#endif
|
||||
}
|
||||
[ProtoMember(1)]
|
||||
public string Key { get; set; }
|
||||
[ProtoMember(2)]
|
||||
public long Value { get; set; }
|
||||
}
|
||||
[ProtoContract]
|
||||
public partial class KeyValueInt32 : AMessage, IProto
|
||||
{
|
||||
public static KeyValueInt32 Create(Scene scene)
|
||||
{
|
||||
return scene.MessagePoolComponent.Rent<KeyValueInt32>();
|
||||
}
|
||||
public override void Dispose()
|
||||
{
|
||||
Key = default;
|
||||
Value = default;
|
||||
#if FANTASY_NET || FANTASY_UNITY
|
||||
GetScene().MessagePoolComponent.Return<KeyValueInt32>(this);
|
||||
#endif
|
||||
}
|
||||
[ProtoMember(1)]
|
||||
public int Key { get; set; }
|
||||
[ProtoMember(2)]
|
||||
public int Value { get; set; }
|
||||
}
|
||||
[ProtoContract]
|
||||
public partial class KeyValueInt64 : AMessage, IProto
|
||||
{
|
||||
public static KeyValueInt64 Create(Scene scene)
|
||||
@@ -103,30 +63,10 @@ namespace NBC
|
||||
#endif
|
||||
}
|
||||
[ProtoMember(1)]
|
||||
public long Key { get; set; }
|
||||
public int Key { get; set; }
|
||||
[ProtoMember(2)]
|
||||
public long Value { get; set; }
|
||||
}
|
||||
[ProtoContract]
|
||||
public partial class KeyValueString : AMessage, IProto
|
||||
{
|
||||
public static KeyValueString Create(Scene scene)
|
||||
{
|
||||
return scene.MessagePoolComponent.Rent<KeyValueString>();
|
||||
}
|
||||
public override void Dispose()
|
||||
{
|
||||
Key = default;
|
||||
Value = default;
|
||||
#if FANTASY_NET || FANTASY_UNITY
|
||||
GetScene().MessagePoolComponent.Return<KeyValueString>(this);
|
||||
#endif
|
||||
}
|
||||
[ProtoMember(1)]
|
||||
public string Key { get; set; }
|
||||
[ProtoMember(2)]
|
||||
public string Value { get; set; }
|
||||
}
|
||||
/// <summary>
|
||||
/// 角色信息
|
||||
/// </summary>
|
||||
@@ -349,7 +289,7 @@ namespace NBC
|
||||
[ProtoMember(3)]
|
||||
public long EndTime { get; set; }
|
||||
[ProtoMember(4)]
|
||||
public List<KeyValueStringInt64> Data = new List<KeyValueStringInt64>();
|
||||
public List<KeyValueInt64> Data = new List<KeyValueInt64>();
|
||||
}
|
||||
/// <summary>
|
||||
/// 技能情况
|
||||
|
||||
@@ -62,7 +62,7 @@ namespace NBC
|
||||
public uint ErrorCode { get; set; }
|
||||
}
|
||||
/// <summary>
|
||||
/// 请求网关离开房间
|
||||
/// 请求网关离开房间(离开房间,但是不离开地图)
|
||||
/// </summary>
|
||||
[ProtoContract]
|
||||
public partial class C2G_ExitRoomRequest : AMessage, IRequest, IProto
|
||||
|
||||
@@ -92,11 +92,9 @@ namespace NBC
|
||||
{
|
||||
Rod = default;
|
||||
Rigs.Clear();
|
||||
LineLength = default;
|
||||
ReelSpeed = default;
|
||||
State = default;
|
||||
Position = default;
|
||||
Rotation = default;
|
||||
Propertys.Clear();
|
||||
#if FANTASY_NET || FANTASY_UNITY
|
||||
GetScene().MessagePoolComponent.Return<GearInfo>(this);
|
||||
#endif
|
||||
@@ -106,15 +104,11 @@ namespace NBC
|
||||
[ProtoMember(2)]
|
||||
public List<long> Rigs = new List<long>();
|
||||
[ProtoMember(3)]
|
||||
public float LineLength { get; set; }
|
||||
[ProtoMember(4)]
|
||||
public float ReelSpeed { get; set; }
|
||||
[ProtoMember(5)]
|
||||
public int State { get; set; }
|
||||
[ProtoMember(6)]
|
||||
public Vector3Info Position { get; set; }
|
||||
[ProtoMember(7)]
|
||||
[ProtoMember(4)]
|
||||
public Vector3Info Rotation { get; set; }
|
||||
[ProtoMember(5)]
|
||||
public List<KeyValueInt64> Propertys = new List<KeyValueInt64>();
|
||||
}
|
||||
[ProtoContract]
|
||||
public partial class UnitStateInfo : AMessage, IProto
|
||||
@@ -126,7 +120,7 @@ namespace NBC
|
||||
public override void Dispose()
|
||||
{
|
||||
State = default;
|
||||
Args.Clear();
|
||||
Propertys.Clear();
|
||||
#if FANTASY_NET || FANTASY_UNITY
|
||||
GetScene().MessagePoolComponent.Return<UnitStateInfo>(this);
|
||||
#endif
|
||||
@@ -134,7 +128,7 @@ namespace NBC
|
||||
[ProtoMember(1)]
|
||||
public int State { get; set; }
|
||||
[ProtoMember(2)]
|
||||
public List<string> Args = new List<string>();
|
||||
public List<KeyValueInt64> Propertys = new List<KeyValueInt64>();
|
||||
}
|
||||
[ProtoContract]
|
||||
public partial class MapUnitInfo : AMessage, IProto
|
||||
@@ -169,6 +163,6 @@ namespace NBC
|
||||
[ProtoMember(6)]
|
||||
public List<GearInfo> Gears = new List<GearInfo>();
|
||||
[ProtoMember(7)]
|
||||
public List<KeyValueInt32> Propertys = new List<KeyValueInt32>();
|
||||
public List<KeyValueInt64> Propertys = new List<KeyValueInt64>();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,28 +18,29 @@ namespace Fantasy
|
||||
public const uint Game2C_GetRoleInfoResponse = 2415929106;
|
||||
public const uint Map2C_RoleEnterRoomNotify = 2147493650;
|
||||
public const uint Map2C_RoleExitRoomNotify = 2147493651;
|
||||
public const uint Map2C_RoleStateNotify = 2147493652;
|
||||
public const uint Map2C_RoleGearChangeNotify = 2147493653;
|
||||
public const uint Map2C_RolePropertyChangeNotify = 2147493654;
|
||||
public const uint C2Map_Move = 2147493655;
|
||||
public const uint C2Map_Look = 2147493656;
|
||||
public const uint Map2C_MoveNotify = 2147493657;
|
||||
public const uint Map2C_LookeNotify = 2147493658;
|
||||
public const uint C2Map_RolePropertyChange = 2147493652;
|
||||
public const uint Map2C_RoleStateNotify = 2147493653;
|
||||
public const uint Map2C_RoleGearChangeNotify = 2147493654;
|
||||
public const uint Map2C_RolePropertyChangeNotify = 2147493655;
|
||||
public const uint C2Map_Move = 2147493656;
|
||||
public const uint C2Map_Look = 2147493657;
|
||||
public const uint Map2C_MoveNotify = 2147493658;
|
||||
public const uint Map2C_LookeNotify = 2147493659;
|
||||
public const uint C2S_GetConversationsRequest = 2281711379;
|
||||
public const uint S2C_GetConversationsResponse = 2415929107;
|
||||
public const uint C2S_SendMailRequest = 2281711380;
|
||||
public const uint S2C_SendMailResponse = 2415929108;
|
||||
public const uint C2S_DeleteMailRequest = 2281711381;
|
||||
public const uint S2C_DeleteMailResponse = 2415929109;
|
||||
public const uint S2C_HaveMail = 2147493659;
|
||||
public const uint S2C_MailState = 2147493660;
|
||||
public const uint S2C_HaveMail = 2147493660;
|
||||
public const uint S2C_MailState = 2147493661;
|
||||
public const uint C2S_CreateChannelRequest = 2281711382;
|
||||
public const uint S2C_CreateChannelResponse = 2415929110;
|
||||
public const uint C2S_JoinChannelRequest = 2281711383;
|
||||
public const uint S2C_JoinChannelResponse = 2415929111;
|
||||
public const uint C2S_SendMessageRequest = 2281711384;
|
||||
public const uint S2C_SendMessageResponse = 2415929112;
|
||||
public const uint S2C_Message = 2147493661;
|
||||
public const uint S2C_Message = 2147493662;
|
||||
public const uint C2S_CreateClubRequest = 2281711385;
|
||||
public const uint S2C_CreateClubResponse = 2415929113;
|
||||
public const uint C2S_GetClubInfoRequest = 2281711386;
|
||||
@@ -56,6 +57,6 @@ namespace Fantasy
|
||||
public const uint S2C_DissolveClubResponse = 2415929119;
|
||||
public const uint C2S_DisposeJoinRequest = 2281711392;
|
||||
public const uint S2C_DisposeJoinResponse = 2415929120;
|
||||
public const uint S2C_ClubChange = 2147493662;
|
||||
public const uint S2C_ClubChange = 2147493663;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,6 +55,26 @@ namespace NBC
|
||||
[ProtoMember(1)]
|
||||
public long Id { get; set; }
|
||||
}
|
||||
[ProtoContract]
|
||||
public partial class C2Map_RolePropertyChange : AMessage, ICustomRouteMessage, IProto
|
||||
{
|
||||
public static C2Map_RolePropertyChange Create(Scene scene)
|
||||
{
|
||||
return scene.MessagePoolComponent.Rent<C2Map_RolePropertyChange>();
|
||||
}
|
||||
public override void Dispose()
|
||||
{
|
||||
Propertys.Clear();
|
||||
#if FANTASY_NET || FANTASY_UNITY
|
||||
GetScene().MessagePoolComponent.Return<C2Map_RolePropertyChange>(this);
|
||||
#endif
|
||||
}
|
||||
public uint OpCode() { return OuterOpcode.C2Map_RolePropertyChange; }
|
||||
[ProtoIgnore]
|
||||
public int RouteType => Fantasy.RouteType.MapRoute;
|
||||
[ProtoMember(1)]
|
||||
public List<KeyValueInt64> Propertys = new List<KeyValueInt64>();
|
||||
}
|
||||
/// <summary>
|
||||
/// 玩家状态变化同步
|
||||
/// </summary>
|
||||
@@ -116,6 +136,7 @@ namespace NBC
|
||||
}
|
||||
public override void Dispose()
|
||||
{
|
||||
Id = default;
|
||||
Propertys.Clear();
|
||||
#if FANTASY_NET || FANTASY_UNITY
|
||||
GetScene().MessagePoolComponent.Return<Map2C_RolePropertyChangeNotify>(this);
|
||||
@@ -125,7 +146,9 @@ namespace NBC
|
||||
[ProtoIgnore]
|
||||
public int RouteType => Fantasy.RouteType.MapRoute;
|
||||
[ProtoMember(1)]
|
||||
public List<KeyValueInt32> Propertys = new List<KeyValueInt32>();
|
||||
public long Id { get; set; }
|
||||
[ProtoMember(2)]
|
||||
public List<KeyValueInt64> Propertys = new List<KeyValueInt64>();
|
||||
}
|
||||
[ProtoContract]
|
||||
public partial class C2Map_Move : AMessage, ICustomRouteMessage, IProto
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using System;
|
||||
using RootMotion.FinalIK;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Serialization;
|
||||
|
||||
namespace NBF
|
||||
{
|
||||
@@ -17,8 +17,17 @@ namespace NBF
|
||||
SpinRod = 2,
|
||||
}
|
||||
|
||||
public class PlayerAnimator : MonoBehaviour
|
||||
public class PlayerAsset : MonoBehaviour
|
||||
{
|
||||
public Transform FPSCamera;
|
||||
public GameObject FishingLight;
|
||||
public Animator Animator { get; private set; }
|
||||
public LookAtIK LookAtIK { get; private set; }
|
||||
public CharacterController CharacterController { get; private set; }
|
||||
public Rigidbody Rigidbody { get; private set; }
|
||||
|
||||
#region 动画
|
||||
|
||||
#region 参数定义
|
||||
|
||||
private static readonly int StartThrowHash = Animator.StringToHash("startThrow");
|
||||
@@ -63,278 +72,268 @@ namespace NBF
|
||||
|
||||
public bool StartThrow
|
||||
{
|
||||
get => animator.GetBool(StartThrowHash);
|
||||
set => animator.SetBool(StartThrowHash, value);
|
||||
get => Animator.GetBool(StartThrowHash);
|
||||
set => Animator.SetBool(StartThrowHash, value);
|
||||
}
|
||||
|
||||
public bool LureThrown
|
||||
{
|
||||
get => animator.GetBool(LureThrownHash);
|
||||
set => animator.SetBool(LureThrownHash, value);
|
||||
get => Animator.GetBool(LureThrownHash);
|
||||
set => Animator.SetBool(LureThrownHash, value);
|
||||
}
|
||||
|
||||
public bool PrepareThrow
|
||||
{
|
||||
get => animator.GetBool(PrepareThrowHash);
|
||||
set => animator.SetBool(PrepareThrowHash, value);
|
||||
get => Animator.GetBool(PrepareThrowHash);
|
||||
set => Animator.SetBool(PrepareThrowHash, value);
|
||||
}
|
||||
|
||||
public bool LeftHand
|
||||
{
|
||||
get => animator.GetBool(LeftHandHash);
|
||||
set => animator.SetBool(LeftHandHash, value);
|
||||
get => Animator.GetBool(LeftHandHash);
|
||||
set => Animator.SetBool(LeftHandHash, value);
|
||||
}
|
||||
|
||||
public float MoveSpeed
|
||||
{
|
||||
get => animator.GetFloat(MoveSpeedHash);
|
||||
set => animator.SetFloat(MoveSpeedHash, value);
|
||||
get => Animator.GetFloat(MoveSpeedHash);
|
||||
set => Animator.SetFloat(MoveSpeedHash, value);
|
||||
}
|
||||
|
||||
public float BoatVelocity
|
||||
{
|
||||
get => animator.GetFloat(BoatVelocityHash);
|
||||
set => animator.SetFloat(BoatVelocityHash, value);
|
||||
get => Animator.GetFloat(BoatVelocityHash);
|
||||
set => Animator.SetFloat(BoatVelocityHash, value);
|
||||
}
|
||||
|
||||
public float BoatDir
|
||||
{
|
||||
get => animator.GetFloat(BoatDirHash);
|
||||
set => animator.SetFloat(BoatDirHash, value);
|
||||
get => Animator.GetFloat(BoatDirHash);
|
||||
set => Animator.SetFloat(BoatDirHash, value);
|
||||
}
|
||||
|
||||
public bool Boat
|
||||
{
|
||||
get => animator.GetBool(BoatHash);
|
||||
set => animator.SetBool(BoatHash, value);
|
||||
get => Animator.GetBool(BoatHash);
|
||||
set => Animator.SetBool(BoatHash, value);
|
||||
}
|
||||
|
||||
public bool Casting
|
||||
{
|
||||
get => animator.GetBool(CastingHash);
|
||||
set => animator.SetBool(CastingHash, value);
|
||||
get => Animator.GetBool(CastingHash);
|
||||
set => Animator.SetBool(CastingHash, value);
|
||||
}
|
||||
|
||||
public bool Telestick
|
||||
{
|
||||
get => animator.GetBool(TelestickHash);
|
||||
set => animator.SetBool(TelestickHash, value);
|
||||
get => Animator.GetBool(TelestickHash);
|
||||
set => Animator.SetBool(TelestickHash, value);
|
||||
}
|
||||
|
||||
public bool TelestickPull
|
||||
{
|
||||
get => animator.GetBool(TelestickPullHash);
|
||||
set => animator.SetBool(TelestickPullHash, value);
|
||||
get => Animator.GetBool(TelestickPullHash);
|
||||
set => Animator.SetBool(TelestickPullHash, value);
|
||||
}
|
||||
|
||||
public bool UseRodPod
|
||||
{
|
||||
get => animator.GetBool(UseRodPodHash);
|
||||
set => animator.SetBool(UseRodPodHash, value);
|
||||
get => Animator.GetBool(UseRodPodHash);
|
||||
set => Animator.SetBool(UseRodPodHash, value);
|
||||
}
|
||||
|
||||
public int ItemSource
|
||||
{
|
||||
get => animator.GetInteger(ItemSourceHash);
|
||||
set => animator.SetInteger(ItemSourceHash, value);
|
||||
get => Animator.GetInteger(ItemSourceHash);
|
||||
set => Animator.SetInteger(ItemSourceHash, value);
|
||||
}
|
||||
|
||||
public int ItemDest
|
||||
{
|
||||
get => animator.GetInteger(ItemDestHash);
|
||||
set => animator.SetInteger(ItemDestHash, value);
|
||||
get => Animator.GetInteger(ItemDestHash);
|
||||
set => Animator.SetInteger(ItemDestHash, value);
|
||||
}
|
||||
|
||||
public bool RodReady
|
||||
{
|
||||
get => animator.GetBool(RodReadyHash);
|
||||
set => animator.SetBool(RodReadyHash, value);
|
||||
get => Animator.GetBool(RodReadyHash);
|
||||
set => Animator.SetBool(RodReadyHash, value);
|
||||
}
|
||||
|
||||
public float HitchRecoverDir
|
||||
{
|
||||
get => animator.GetFloat(HitchRecoverDirHash);
|
||||
set => animator.SetFloat(HitchRecoverDirHash, value);
|
||||
get => Animator.GetFloat(HitchRecoverDirHash);
|
||||
set => Animator.SetFloat(HitchRecoverDirHash, value);
|
||||
}
|
||||
|
||||
public void SetHitchRecoverTrigger()
|
||||
{
|
||||
animator.SetTrigger(HitchRecoverHash);
|
||||
Animator.SetTrigger(HitchRecoverHash);
|
||||
}
|
||||
|
||||
public void ResetHitchRecoverTrigger()
|
||||
{
|
||||
animator.ResetTrigger(HitchRecoverHash);
|
||||
Animator.ResetTrigger(HitchRecoverHash);
|
||||
}
|
||||
|
||||
public float SitOrStand
|
||||
{
|
||||
get => animator.GetFloat(SitOrStandHash);
|
||||
set => animator.SetFloat(SitOrStandHash, value);
|
||||
get => Animator.GetFloat(SitOrStandHash);
|
||||
set => Animator.SetFloat(SitOrStandHash, value);
|
||||
}
|
||||
|
||||
public bool Shteker
|
||||
{
|
||||
get => animator.GetBool(ShtekerHash);
|
||||
set => animator.SetBool(ShtekerHash, value);
|
||||
get => Animator.GetBool(ShtekerHash);
|
||||
set => Animator.SetBool(ShtekerHash, value);
|
||||
}
|
||||
|
||||
public bool ItemInHands
|
||||
{
|
||||
get => animator.GetBool(ItemInHandsHash);
|
||||
set => animator.SetBool(ItemInHandsHash, value);
|
||||
get => Animator.GetBool(ItemInHandsHash);
|
||||
set => Animator.SetBool(ItemInHandsHash, value);
|
||||
}
|
||||
|
||||
public bool ChangeItem
|
||||
{
|
||||
get => animator.GetBool(ChangeItemHash);
|
||||
set => animator.SetBool(ChangeItemHash, value);
|
||||
get => Animator.GetBool(ChangeItemHash);
|
||||
set => Animator.SetBool(ChangeItemHash, value);
|
||||
}
|
||||
|
||||
public HandItemType ItemType
|
||||
{
|
||||
get => (HandItemType)animator.GetInteger(ItemTypeHash);
|
||||
set => animator.SetInteger(ItemTypeHash, (int)value);
|
||||
get => (HandItemType)Animator.GetInteger(ItemTypeHash);
|
||||
set => Animator.SetInteger(ItemTypeHash, (int)value);
|
||||
}
|
||||
|
||||
public void SetItemActionTrigger()
|
||||
{
|
||||
animator.SetTrigger(ItemActionHash);
|
||||
Animator.SetTrigger(ItemActionHash);
|
||||
}
|
||||
|
||||
public void ResetItemActionTrigger()
|
||||
{
|
||||
animator.ResetTrigger(ItemActionHash);
|
||||
Animator.ResetTrigger(ItemActionHash);
|
||||
}
|
||||
|
||||
public float ItemActionPower
|
||||
{
|
||||
get => animator.GetFloat(ItemActionPowerHash);
|
||||
set => animator.SetFloat(ItemActionPowerHash, value);
|
||||
get => Animator.GetFloat(ItemActionPowerHash);
|
||||
set => Animator.SetFloat(ItemActionPowerHash, value);
|
||||
}
|
||||
|
||||
public bool PodsakAction
|
||||
{
|
||||
get => animator.GetBool(PodsakActionHash);
|
||||
set => animator.SetBool(PodsakActionHash, value);
|
||||
get => Animator.GetBool(PodsakActionHash);
|
||||
set => Animator.SetBool(PodsakActionHash, value);
|
||||
}
|
||||
|
||||
public bool PullUpRod
|
||||
{
|
||||
get => animator.GetBool(PullUpRodHash);
|
||||
set => animator.SetBool(PullUpRodHash, value);
|
||||
get => Animator.GetBool(PullUpRodHash);
|
||||
set => Animator.SetBool(PullUpRodHash, value);
|
||||
}
|
||||
|
||||
public float FishingFinal
|
||||
{
|
||||
get => animator.GetFloat(FishingFinalHash);
|
||||
set => animator.SetFloat(FishingFinalHash, value);
|
||||
get => Animator.GetFloat(FishingFinalHash);
|
||||
set => Animator.SetFloat(FishingFinalHash, value);
|
||||
}
|
||||
|
||||
public float SpinOrTele
|
||||
{
|
||||
get => animator.GetFloat(SpinOrTeleHash);
|
||||
set => animator.SetFloat(SpinOrTeleHash, value);
|
||||
get => Animator.GetFloat(SpinOrTeleHash);
|
||||
set => Animator.SetFloat(SpinOrTeleHash, value);
|
||||
}
|
||||
|
||||
public void SetTwitchTrigger()
|
||||
{
|
||||
animator.SetTrigger(TwitchHash);
|
||||
Animator.SetTrigger(TwitchHash);
|
||||
}
|
||||
|
||||
public void ResetTwitchTrigger()
|
||||
{
|
||||
animator.ResetTrigger(TwitchHash);
|
||||
Animator.ResetTrigger(TwitchHash);
|
||||
}
|
||||
|
||||
public float TwitchDir
|
||||
{
|
||||
get => animator.GetFloat(TwitchDirHash);
|
||||
set => animator.SetFloat(TwitchDirHash, value);
|
||||
get => Animator.GetFloat(TwitchDirHash);
|
||||
set => Animator.SetFloat(TwitchDirHash, value);
|
||||
}
|
||||
|
||||
public float ThrowSpeedMult
|
||||
{
|
||||
get => animator.GetFloat(ThrowSpeedMultHash);
|
||||
set => animator.SetFloat(ThrowSpeedMultHash, value);
|
||||
get => Animator.GetFloat(ThrowSpeedMultHash);
|
||||
set => Animator.SetFloat(ThrowSpeedMultHash, value);
|
||||
}
|
||||
|
||||
public void SetConvTestTrigger()
|
||||
{
|
||||
animator.SetTrigger(ConvTestHash);
|
||||
Animator.SetTrigger(ConvTestHash);
|
||||
}
|
||||
|
||||
public void ResetConvTestTrigger()
|
||||
{
|
||||
animator.ResetTrigger(ConvTestHash);
|
||||
Animator.ResetTrigger(ConvTestHash);
|
||||
}
|
||||
|
||||
public int BoatPose
|
||||
{
|
||||
get => animator.GetInteger(BoatPoseHash);
|
||||
set => animator.SetInteger(BoatPoseHash, value);
|
||||
get => Animator.GetInteger(BoatPoseHash);
|
||||
set => Animator.SetInteger(BoatPoseHash, value);
|
||||
}
|
||||
|
||||
public float QuadDirection
|
||||
{
|
||||
get => animator.GetFloat(QuadDirectionHash);
|
||||
set => animator.SetFloat(QuadDirectionHash, value);
|
||||
get => Animator.GetFloat(QuadDirectionHash);
|
||||
set => Animator.SetFloat(QuadDirectionHash, value);
|
||||
}
|
||||
|
||||
public bool StretchMax
|
||||
{
|
||||
get => animator.GetBool(StretchMaxHash);
|
||||
set => animator.SetBool(StretchMaxHash, value);
|
||||
get => Animator.GetBool(StretchMaxHash);
|
||||
set => Animator.SetBool(StretchMaxHash, value);
|
||||
}
|
||||
|
||||
public void SetExamineItemTrigger()
|
||||
{
|
||||
animator.SetTrigger(ExamineItemHash);
|
||||
Animator.SetTrigger(ExamineItemHash);
|
||||
}
|
||||
|
||||
public void ResetExamineItemTrigger()
|
||||
{
|
||||
animator.ResetTrigger(ExamineItemHash);
|
||||
Animator.ResetTrigger(ExamineItemHash);
|
||||
}
|
||||
|
||||
public float TillerDirection
|
||||
{
|
||||
get => animator.GetFloat(TillerDirectionHash);
|
||||
set => animator.SetFloat(TillerDirectionHash, value);
|
||||
get => Animator.GetFloat(TillerDirectionHash);
|
||||
set => Animator.SetFloat(TillerDirectionHash, value);
|
||||
}
|
||||
|
||||
public void SetTestTrigger()
|
||||
{
|
||||
animator.SetTrigger(TestTriggerHash);
|
||||
Animator.SetTrigger(TestTriggerHash);
|
||||
}
|
||||
|
||||
public void ResetTestTrigger()
|
||||
{
|
||||
animator.ResetTrigger(TestTriggerHash);
|
||||
Animator.ResetTrigger(TestTriggerHash);
|
||||
}
|
||||
|
||||
public ThrowModeEnum ThrowMode
|
||||
{
|
||||
get
|
||||
{
|
||||
var val = animator.GetInteger(ThrowModeHash);
|
||||
var val = Animator.GetInteger(ThrowModeHash);
|
||||
return (ThrowModeEnum)val;
|
||||
}
|
||||
set => animator.SetInteger(ThrowModeHash, (int)value);
|
||||
set => Animator.SetInteger(ThrowModeHash, (int)value);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
// public FPlayer Player;
|
||||
|
||||
public Animator animator;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
animator = GetComponent<Animator>();
|
||||
}
|
||||
|
||||
|
||||
#region 动画事件回调
|
||||
|
||||
/// <summary>
|
||||
@@ -349,5 +348,16 @@ namespace NBF
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
Animator = GetComponent<Animator>();
|
||||
LookAtIK = GetComponent<LookAtIK>();
|
||||
CharacterController = GetComponent<CharacterController>();
|
||||
Rigidbody = GetComponent<Rigidbody>();
|
||||
LookAtIK.enabled = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
3
Assets/Scripts/Model/Assets/PlayerAsset.cs.meta
Normal file
3
Assets/Scripts/Model/Assets/PlayerAsset.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 553e656eacf648afb33751a88352d216
|
||||
timeCreated: 1757836335
|
||||
@@ -98,7 +98,7 @@ namespace NBF.Fishing2
|
||||
{
|
||||
App.Main.EventComponent.Publish(new NumericChange()
|
||||
{ MapUnit = self.GetParent<MapUnit>(), New = value, Old = oldValue, NumericType = numericType });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static long GetByKey(this NumericComponent self, int key)
|
||||
|
||||
@@ -3,6 +3,9 @@
|
||||
public static class NumericType
|
||||
{
|
||||
public const int Max = 10000;
|
||||
|
||||
/// <summary>
|
||||
/// 手电筒
|
||||
/// </summary>
|
||||
public const int Flashlight = 100;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user