大修改调整
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
using Fantasy.Entitas;
|
||||
using Fantasy;
|
||||
using Fantasy.Entitas;
|
||||
using Fantasy.Entitas.Interface;
|
||||
using NBC;
|
||||
using UnityEngine;
|
||||
using UnityEngine.InputSystem;
|
||||
using Log = NBC.Log;
|
||||
|
||||
namespace NBF
|
||||
{
|
||||
@@ -89,8 +90,15 @@ namespace NBF
|
||||
var item = RoleModel.Instance.GetSlotItem(index - 1);
|
||||
if (item != null)
|
||||
{
|
||||
Player.UseItem(item);
|
||||
// Game.Instance.StartCoroutine(UseItem(item));
|
||||
var itemBindInfo = ItemBindInfo.Create();
|
||||
itemBindInfo.Item = item.ConfigId;
|
||||
var binds = RoleModel.Instance.GetBindItems(item.Id);
|
||||
foreach (var itemInfo in binds)
|
||||
{
|
||||
itemBindInfo.BindItems.Add(itemInfo.ConfigId);
|
||||
}
|
||||
|
||||
Player.UseItem(itemBindInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -121,7 +129,7 @@ namespace NBF
|
||||
|
||||
#region Move
|
||||
|
||||
private Quaternion lastRotation;
|
||||
private Quaternion _lastRotation;
|
||||
|
||||
private void UpdateMove()
|
||||
{
|
||||
@@ -155,7 +163,7 @@ namespace NBF
|
||||
Quaternion rotation = View.Unity.FirstPerson.transform.rotation;
|
||||
|
||||
// 计算当前帧与上一帧的旋转差异
|
||||
Quaternion rotationDelta = rotation * Quaternion.Inverse(lastRotation);
|
||||
Quaternion rotationDelta = rotation * Quaternion.Inverse(_lastRotation);
|
||||
|
||||
// 将四元数转换为角度轴表示
|
||||
rotationDelta.ToAngleAxis(out float angle, out Vector3 axis);
|
||||
@@ -179,7 +187,7 @@ namespace NBF
|
||||
|
||||
Player.RotationSpeed = turnValue;
|
||||
|
||||
lastRotation = rotation;
|
||||
_lastRotation = rotation;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
Reference in New Issue
Block a user