属性控制

This commit is contained in:
2025-09-14 16:26:41 +08:00
parent 57d360f922
commit 3c022ff4b6
43 changed files with 343 additions and 340 deletions

Binary file not shown.

Binary file not shown.

View File

@@ -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: []

View File

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

View File

@@ -51,6 +51,7 @@ namespace NBF
public const string Move = "Move";
public const string Look = "Look";
public const string UseTorch = "UseTorch";
}
#region Load Icon

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: b35630cbcbbb4792a821de847fabbd69
timeCreated: 1757820526

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: c197c410c838437996d832515a62026e
timeCreated: 1757835465

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

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 2dae2fd757bc46b7b47a7b548b36ed54
timeCreated: 1757835696

View File

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

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: b507863390534ecca584e3a787180493
timeCreated: 1757820797

View File

@@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: cddbe2f2da274f6196485f744b618c86
timeCreated: 1756820608

View File

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

View File

@@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: 660d750ed1f74128a55bbb574d772af4
timeCreated: 1756115969

View File

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

View File

@@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: 2b438b0d299c4b7186d21faf5de07cca
timeCreated: 1756882697

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 35bf130c632b4a31b064a6d0706aba65
timeCreated: 1757835845

View File

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

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: b498c6d3db5b4d44a1dc99b547416d59
timeCreated: 1757836076

View File

@@ -54,7 +54,6 @@ namespace NBF.Fishing2
public void SetUnitInfo(MapUnitInfo unitInfo)
{
GetOrAddComponent<MoveComponent>();
GetOrAddComponent<ObjectWait>();
var unitBasic = GetOrAddComponent<MapUnitBasic>();
unitBasic.UpdateInfo(unitInfo);

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 309507c5427f4a95bb64f526ce60ded0
timeCreated: 1757820516

View File

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

View File

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

View File

@@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: 6afa60e6892f49d0aed14024432ab10d
timeCreated: 1755917036

View File

@@ -1,12 +0,0 @@
using NBC.Entitas;
namespace NBF.Fishing2
{
/// <summary>
/// Unit 对应的 HUD对象
/// </summary>
public class UnitHUDComponent : Entity
{
}
}

View File

@@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: 7b8cd51029604d83a328fd19b8b80d53
timeCreated: 1755921088

View File

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

View File

@@ -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>
/// 技能情况

View File

@@ -62,7 +62,7 @@ namespace NBC
public uint ErrorCode { get; set; }
}
/// <summary>
/// 请求网关离开房间
/// 请求网关离开房间(离开房间,但是不离开地图)
/// </summary>
[ProtoContract]
public partial class C2G_ExitRoomRequest : AMessage, IRequest, IProto

View File

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

View File

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

View File

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

View File

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

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 553e656eacf648afb33751a88352d216
timeCreated: 1757836335

View File

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

View File

@@ -3,6 +3,9 @@
public static class NumericType
{
public const int Max = 10000;
/// <summary>
/// 手电筒
/// </summary>
public const int Flashlight = 100;
}
}

View File

@@ -8,6 +8,9 @@ EditorBuildSettings:
- enabled: 1
path: Assets/Scenes/StartUp.unity
guid: 64599d3325ec9504aa804534e2feeab6
- enabled: 1
path: Assets/ResRaw/Maps/Map1/Map1.unity
guid: 087123319930fec42beb5f420fdf983b
- enabled: 1
path: Assets/ResRaw/Maps/Map3/Map3.unity
guid: 421377fa48d283f43be4eadc5ffebfb4

View File

@@ -9,35 +9,35 @@ EditorUserSettings:
value: 18134705175a055722080a3115371d4a0d55006876786860616b0471b8b07a68ffab74f9ee2a3a30300cea1a11320d0beb1a0c25f7060f494b4cc80018eb09361fc211cb1f862d19c51d19dcc413d6ade0d8ddfcddf9f4d9d29195fcfde6ebeae6f0a9c9afa6f8c5b89ff7a1aacececac4eba4d7c9d28bda
flags: 0
RecentlyUsedSceneGuid-0:
value: 020056535456585e0f0d0a7541210d441215482c2d297f36752c1b65b3b0376e
flags: 0
RecentlyUsedSceneGuid-1:
value: 5607575f01045803555a5b74167b0c4414164e737a2c7060297b4862bbb1636e
flags: 0
RecentlyUsedSceneGuid-2:
RecentlyUsedSceneGuid-1:
value: 5b0206565505590b545d5e7240730f4014444a7a7c7876602e7a4f63b2b06468
flags: 0
RecentlyUsedSceneGuid-3:
RecentlyUsedSceneGuid-2:
value: 025005075d000f0c095c0f7145730b4447161e2c787923327a7c4965e0b66669
flags: 0
RecentlyUsedSceneGuid-4:
value: 5703055552020f5a595608704870594445151d7e29292233782f1b36e0e6366c
flags: 0
RecentlyUsedSceneGuid-5:
value: 5309035757065a0a54575f7216265c4444151d28792e72627d2f1935bbb8673a
flags: 0
RecentlyUsedSceneGuid-6:
value: 5a04020456005d5f5f565b7747720a44474f1e7f7b7c20332b7c4d62b1b6673d
flags: 0
RecentlyUsedSceneGuid-7:
value: 5505015f5c515a085f5b092149760f441716407a787d7564287b1b36e7e1366e
flags: 0
RecentlyUsedSceneGuid-8:
RecentlyUsedSceneGuid-3:
value: 5254555355510f0b095b557b157108444f164d7e2d707363287b1c65b7b4673c
flags: 0
RecentlyUsedSceneGuid-9:
RecentlyUsedSceneGuid-4:
value: 5a00525654510d0a5b5f5f76497b5e44474f1e7a287875697c7b4967b0b2316f
flags: 0
RecentlyUsedSceneGuid-5:
value: 5a04020456005d5f5f565b7747720a44474f1e7f7b7c20332b7c4d62b1b6673d
flags: 0
RecentlyUsedSceneGuid-6:
value: 5703055552020f5a595608704870594445151d7e29292233782f1b36e0e6366c
flags: 0
RecentlyUsedSceneGuid-7:
value: 020801035c53500a580c0f7145700c4444164d2e797d7f332c704963b0b06260
flags: 0
RecentlyUsedSceneGuid-8:
value: 5309035757065a0a54575f7216265c4444151d28792e72627d2f1935bbb8673a
flags: 0
RecentlyUsedSceneGuid-9:
value: 5505015f5c515a085f5b092149760f441716407a787d7564287b1b36e7e1366e
flags: 0
UnityEditor.ShaderGraph.Blackboard:
value: 18135939215a0a5004000b0e15254b524c030a3f2964643d120d1230e9e93a3fd6e826abbd2e2d293c4ead313b08042de6030a0afa240c0d020be94c4ba75e435d8715fa32c70d15d11612dacc11fee5d3c5d1fe9ab1bf968e93e2ffcbc3e7e2f0b3ffe0e8b0be9afeffa9ffff8e85dd8390e2969e8899daa7
flags: 0