切换主武器
This commit is contained in:
@@ -1,23 +1,51 @@
|
||||
using System.Collections.Generic;
|
||||
using Cielonos.MainGame.Inventory;
|
||||
using Sirenix.OdinInspector;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Serialization;
|
||||
|
||||
namespace Cielonos.MainGame.Characters
|
||||
{
|
||||
public class BodyPartsSubcontroller : SubcontrollerBase<CharacterBase>
|
||||
public partial class BodyPartsSubcontroller : SubcontrollerBase<CharacterBase>
|
||||
{
|
||||
[FormerlySerializedAs("centerPoint")] [Title("Main Parts")]
|
||||
[Title("Main Parts")]
|
||||
public Transform flexibleCenterPoint;
|
||||
public Transform staticCenterPoint;
|
||||
public Transform cameraLockingPoint;
|
||||
public Transform footPoint;
|
||||
public Transform head;
|
||||
public Transform leftHand;
|
||||
public Transform rightHand;
|
||||
public Transform back;
|
||||
public Transform hips;
|
||||
public Transform leftFoot;
|
||||
public Transform rightFoot;
|
||||
|
||||
[Title("Custom Parts")]
|
||||
public Dictionary<string, Transform> customBodyParts;
|
||||
}
|
||||
|
||||
public partial class BodyPartsSubcontroller
|
||||
{
|
||||
public Transform GetPart(ViewObjectData.AttachBodyPartType partType)
|
||||
{
|
||||
return partType switch
|
||||
{
|
||||
ViewObjectData.AttachBodyPartType.RightHand => rightHand,
|
||||
ViewObjectData.AttachBodyPartType.LeftHand => leftHand,
|
||||
ViewObjectData.AttachBodyPartType.Head => head,
|
||||
ViewObjectData.AttachBodyPartType.FlexibleCenterPoint => flexibleCenterPoint,
|
||||
ViewObjectData.AttachBodyPartType.Back => back,
|
||||
ViewObjectData.AttachBodyPartType.Hips => hips,
|
||||
ViewObjectData.AttachBodyPartType.RightFoot => rightFoot,
|
||||
ViewObjectData.AttachBodyPartType.LeftFoot => leftFoot,
|
||||
_ => null
|
||||
};
|
||||
}
|
||||
|
||||
public Transform GetPart(string partName)
|
||||
{
|
||||
return customBodyParts.GetValueOrDefault(partName);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -56,7 +56,7 @@ namespace Cielonos.MainGame.Characters
|
||||
|
||||
if (owner is Player player)
|
||||
{
|
||||
dashRotation.y = player.viewSc.isLockingTarget
|
||||
dashRotation.y = player.viewSc.lockTargetModule.isUsingLockTargetCamera
|
||||
? player.viewSc.cameraRotationSm.cinemachineEndLockYaw + angle
|
||||
: player.viewSc.cameraRotationSm.cinemachineTargetYaw + angle;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user