diff --git a/Assets/ResRaw/Prefabs/Line/LineHand1.prefab b/Assets/ResRaw/Prefabs/Line/LineHand1.prefab index 3b3c8200d..5fd1516d6 100644 --- a/Assets/ResRaw/Prefabs/Line/LineHand1.prefab +++ b/Assets/ResRaw/Prefabs/Line/LineHand1.prefab @@ -402,10 +402,6 @@ MonoBehaviour: showDebugInfo: 1 defaultTransitionSpeed: 2 LinelenghtDiferent: 0 - lengthLimitTolerance: 0.01 - breakStretchThreshold: 0.3 - breakStretchPercentMinThreshold: 0.06 - breakLimitDuration: 3 --- !u!1 &1858052053854210 GameObject: m_ObjectHideFlags: 0 @@ -781,7 +777,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 7f840e1966fd4c2aafe2f37ca260cdd2, type: 3} m_Name: m_EditorClassIdentifier: Assembly-CSharp::NBF.FLineLogicNode - NodeType: 1 + NodeType: 0 rope: {fileID: 0} preRigidbody: {fileID: 0} --- !u!1 &3739175077773299312 diff --git a/Assets/Scripts/Fishing/Item/FishingLine/FLine.cs b/Assets/Scripts/Fishing/Item/FishingLine/FLine.cs index 5d9afc72e..6cc60daf5 100644 --- a/Assets/Scripts/Fishing/Item/FishingLine/FLine.cs +++ b/Assets/Scripts/Fishing/Item/FishingLine/FLine.cs @@ -133,7 +133,7 @@ namespace NBF private void Update() { - LinelenghtDiferent = GetLineDistance(); + // LinelenghtDiferent = GetLineDistance(); //非钓鱼状态 if (Rod) Rod.Tension = Mathf.Clamp(LinelenghtDiferent, 0f, 0.05f); diff --git a/Assets/Scripts/Fishing/Item/PlayerItem.cs b/Assets/Scripts/Fishing/Item/PlayerItem.cs index dd0821340..9d0498a21 100644 --- a/Assets/Scripts/Fishing/Item/PlayerItem.cs +++ b/Assets/Scripts/Fishing/Item/PlayerItem.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; +using Fantasy.Async; using UnityEngine; namespace NBF @@ -15,12 +16,18 @@ namespace NBF public Player Owner; - public virtual void Init(Player player, int configId, List bindItems) + public virtual async FTask Init(Player player, int configId, List bindItems) { Owner = player; ConfigID = configId; BindItems.Clear(); BindItems.AddRange(bindItems); + await OnInit(); + } + + protected virtual async FTask OnInit() + { + await FTask.CompletedTask; } } } \ No newline at end of file diff --git a/Assets/Scripts/Fishing/Item/Tackle/FRod.cs b/Assets/Scripts/Fishing/Item/Tackle/FRod.cs index 8577db9da..98859205a 100644 --- a/Assets/Scripts/Fishing/Item/Tackle/FRod.cs +++ b/Assets/Scripts/Fishing/Item/Tackle/FRod.cs @@ -156,7 +156,7 @@ namespace NBF yield return 1; } - public async FTask InitRod() + protected override async FTask OnInit() { transform.localPosition = Vector3.zero; transform.localRotation = Quaternion.identity; @@ -293,7 +293,7 @@ namespace NBF var solver = Instantiate(lineSolverPrefab, GearRoot); solver.transform.position = Asset.lineConnector.position; solver.transform.rotation = Asset.lineConnector.rotation; - var indexNames = new[] { "fishing line float set", "fishing line spinning" }; + var indexNames = new[] { "LineHand1", "LineHand1" }; var path = $"Assets/ResRaw/Prefabs/Line/{indexNames[currentLineTypeIndex]}.prefab"; var prefab = Assets.Load(path); diff --git a/Assets/Scripts/Fishing/Map/Map.cs b/Assets/Scripts/Fishing/Map/Map.cs index 52e827cd5..0dd4812a2 100644 --- a/Assets/Scripts/Fishing/Map/Map.cs +++ b/Assets/Scripts/Fishing/Map/Map.cs @@ -72,7 +72,7 @@ namespace NBF private void UpdateTimeOfDay() { var p = GameTimer.GetGameDayProgress(); - p = 0.3f; + p = 0.1f; // Debug.Log(p); EnviroManager.instance.Time.SetTimeOfDay(p * 24f); // if(AzureCoreSystem) diff --git a/Assets/Scripts/Fishing/Player/Player.cs b/Assets/Scripts/Fishing/Player/Player.cs index 1dc4a4312..197c2613b 100644 --- a/Assets/Scripts/Fishing/Player/Player.cs +++ b/Assets/Scripts/Fishing/Player/Player.cs @@ -77,6 +77,12 @@ namespace NBF await UnUseItem(); } + var itemConfig = Game.Tables.TbItem.Get(configId); + var Rod = itemConfig.InstantiateAndComponent(Map.Instance.GearsNode, Vector3.zero, + Quaternion.identity); + await Rod.Init(this, configId, bindItems); + HandItem = Rod; + // ModelAsset.PlayerAnimator.OnUseItem(itemView); // if (currItem == null)