我正在创建一个游戏,但我在编写瞄准机制时遇到问题,并且在“偏移”方面遇到问题。
这是我收到的错误:“错误 CS1503:参数 2:无法从“对象”转换为“UnityEngine.Vector2””
protected virtual void UpdateHeadTrack()
{
if (!shooterManager || !headTrack)
{
if (headTrack) headTrack.offsetSpine = Vector2.Lerp(headTrack.offsetSpine, Vector2.zero, headTrack.smooth * Time.deltaTime);
return;
}
if (!CurrentWeapon || !headTrack)
{
if (headTrack) headTrack.offsetSpine = Vector2.Lerp(headTrack.offsetSpine, Vector2.zero, headTrack.smooth * Time.deltaTime);
return;
}
if (isAiming || aimTimming > 0f)
{
object offset = cc.isCrouching ? CurrentWeapon.headTrackOffsetCrouch : CurrentWeapon.headTrackOffset;
headTrack.offsetSpine = Vector2.Lerp(headTrack.offsetSpine, offset, headTrack.smooth * Time.deltaTime);
}
else
{
headTrack.offsetSpine = Vector2.Lerp(headTrack.offsetSpine, Vector2.zero, headTrack.smooth * Time.deltaTime);
}
}
动漫人物
相关分类