导入角色动画,和增加角色控制
This commit is contained in:
@@ -1,94 +0,0 @@
|
||||
using System;
|
||||
using RootMotion.FinalIK;
|
||||
using UnityEngine;
|
||||
|
||||
namespace NBF
|
||||
{
|
||||
public enum PlayerState
|
||||
{
|
||||
idle = 0,
|
||||
move = 1,
|
||||
prepare = 2,
|
||||
casting = 3,
|
||||
fishing = 4,
|
||||
baitFlies = 5,
|
||||
fight = 6,
|
||||
fishView = 7,
|
||||
collectFish = 8,
|
||||
throwFish = 9,
|
||||
vehicle = 10,
|
||||
swiming = 11,
|
||||
flyModeDebug = 12,
|
||||
vehicleFishing = 13,
|
||||
preciseCastIdle = 14,
|
||||
preciseCastThrow = 15
|
||||
}
|
||||
|
||||
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 参数定义
|
||||
|
||||
public static readonly int IsSwiming = Animator.StringToHash("Swim");
|
||||
|
||||
public static readonly int ThrowFar = Animator.StringToHash("ThrowFar");
|
||||
|
||||
public static readonly int BoatDriving = Animator.StringToHash("BoatDriving");
|
||||
|
||||
public static readonly int BaitInWater = Animator.StringToHash("BaitInWater");
|
||||
|
||||
public static readonly int HeldRod = Animator.StringToHash("HeldRod");
|
||||
|
||||
public static readonly int RodArming = Animator.StringToHash("RodArming");
|
||||
|
||||
public static readonly int Forward = Animator.StringToHash("Forward");
|
||||
|
||||
public static readonly int Turn = Animator.StringToHash("Turn");
|
||||
|
||||
public static readonly int OnGround = Animator.StringToHash("OnGround");
|
||||
|
||||
public static readonly int RodRight = Animator.StringToHash("rod right");
|
||||
|
||||
public static readonly int RodForward = Animator.StringToHash("rod forward");
|
||||
|
||||
public static readonly int PreciseCast = Animator.StringToHash("Precise Cast");
|
||||
|
||||
public static readonly int PreciseIdle = Animator.StringToHash("Precise Idle");
|
||||
|
||||
#endregion
|
||||
|
||||
#region 动画事件回调
|
||||
|
||||
/// <summary>
|
||||
/// 抛竿开始
|
||||
/// </summary>
|
||||
public void RodForceThrowStart()
|
||||
{
|
||||
// if (Player.Fsm.CurrentState is PlayerThrow playerThrow)
|
||||
// {
|
||||
// playerThrow.RodForceThrowStart();
|
||||
// }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
Animator = GetComponent<Animator>();
|
||||
LookAtIK = GetComponent<LookAtIK>();
|
||||
CharacterController = GetComponent<CharacterController>();
|
||||
Rigidbody = GetComponent<Rigidbody>();
|
||||
LookAtIK.enabled = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
47
Assets/Scripts/Model/Assets/PlayerModelAsset.cs
Normal file
47
Assets/Scripts/Model/Assets/PlayerModelAsset.cs
Normal file
@@ -0,0 +1,47 @@
|
||||
using System;
|
||||
using KINEMATION.MagicBlend.Runtime;
|
||||
using RootMotion.FinalIK;
|
||||
using UnityEngine;
|
||||
|
||||
namespace NBF
|
||||
{
|
||||
public enum PlayerState
|
||||
{
|
||||
idle = 0,
|
||||
move = 1,
|
||||
prepare = 2,
|
||||
casting = 3,
|
||||
fishing = 4,
|
||||
baitFlies = 5,
|
||||
fight = 6,
|
||||
fishView = 7,
|
||||
collectFish = 8,
|
||||
throwFish = 9,
|
||||
vehicle = 10,
|
||||
swiming = 11,
|
||||
flyModeDebug = 12,
|
||||
vehicleFishing = 13,
|
||||
preciseCastIdle = 14,
|
||||
preciseCastThrow = 15
|
||||
}
|
||||
|
||||
public class PlayerModelAsset : MonoBehaviour
|
||||
{
|
||||
public Animator Animator { get; private set; }
|
||||
public PlayerIK IK { get; private set; }
|
||||
public MagicBlending MagicBlending { get; private set; }
|
||||
|
||||
public Transform NeckTransform;
|
||||
public LookAtIK LookIk;
|
||||
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
LookIk = GetComponent<LookAtIK>();
|
||||
Animator = GetComponent<Animator>();
|
||||
Animator.keepAnimatorStateOnDisable = true;
|
||||
MagicBlending = GetComponent<MagicBlending>();
|
||||
IK = GetComponent<PlayerIK>();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -13,8 +13,14 @@ namespace NBF
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
#if CINEMACHINE_URP
|
||||
int i = 0;
|
||||
#endif
|
||||
Init();
|
||||
DontDestroyOnLoad(gameObject);
|
||||
DepthOfField dof = ScriptableObject.CreateInstance<DepthOfField>();
|
||||
dof.aperture.value = 0;
|
||||
dof.focalLength.value = 0;
|
||||
}
|
||||
|
||||
public void Init()
|
||||
|
||||
22
Assets/Scripts/Model/Common/Enum/MapUnitState.cs
Normal file
22
Assets/Scripts/Model/Common/Enum/MapUnitState.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
namespace NBF
|
||||
{
|
||||
public enum MapUnitState
|
||||
{
|
||||
idle = 0,
|
||||
move = 1,
|
||||
prepare = 2,
|
||||
casting = 3,
|
||||
fishing = 4,
|
||||
baitFlies = 5,
|
||||
fight = 6,
|
||||
fishView = 7,
|
||||
collectFish = 8,
|
||||
throwFish = 9,
|
||||
vehicle = 10,
|
||||
swiming = 11,
|
||||
flyModeDebug = 12,
|
||||
vehicleFishing = 13,
|
||||
preciseCastIdle = 14,
|
||||
preciseCastThrow = 15
|
||||
}
|
||||
}
|
||||
3
Assets/Scripts/Model/Common/Enum/MapUnitState.cs.meta
Normal file
3
Assets/Scripts/Model/Common/Enum/MapUnitState.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6a25ab9f9b4140c7bd3e463da484301e
|
||||
timeCreated: 1765284104
|
||||
@@ -80,7 +80,7 @@ namespace NBF
|
||||
Log.Warning("账号没有进入过地图,进入新手引导地图");
|
||||
mapId = 99;
|
||||
}
|
||||
// await MapHelper.EnterMap(mapId, role.RoomCode);
|
||||
await MapHelper.EnterMap(mapId, role.RoomCode);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user