fix anim
This commit is contained in:
+1
-1
@@ -6,7 +6,7 @@ AnimationClip:
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: "\u7AD9\u7ACB\u7A7A\u62F3"
|
||||
m_Name: "\u7AD9\u7ACB_\u7A7A\u62F3"
|
||||
serializedVersion: 7
|
||||
m_Legacy: 0
|
||||
m_Compressed: 0
|
||||
@@ -8,6 +8,7 @@ using System;
|
||||
using System.Threading.Tasks;
|
||||
using Unity.VisualScripting;
|
||||
using UnityEngine;
|
||||
using static UnityEditor.PlayerSettings;
|
||||
|
||||
public class CECNPC : CECObject
|
||||
{
|
||||
@@ -673,7 +674,7 @@ public class CECNPC : CECObject
|
||||
{
|
||||
// Already at destination
|
||||
_characterController.enabled = false;
|
||||
transform.position = EC_Utility.ToVector3(m_vServerPos);
|
||||
SetPos( EC_Utility.ToVector3(m_vServerPos));
|
||||
_characterController.enabled = true;
|
||||
bRet = true;
|
||||
}
|
||||
@@ -691,7 +692,7 @@ public class CECNPC : CECObject
|
||||
{
|
||||
// Teleport nếu lag xa
|
||||
_characterController.enabled = false;
|
||||
transform.position = EC_Utility.ToVector3(m_vServerPos);
|
||||
SetPos( EC_Utility.ToVector3(m_vServerPos));
|
||||
_characterController.enabled = true;
|
||||
|
||||
m_vStopDir = EC_Utility.ToA3DVECTOR3(transform.forward);
|
||||
@@ -1121,6 +1122,10 @@ public class CECNPC : CECObject
|
||||
}
|
||||
void SetPos(Vector3 pos)
|
||||
{
|
||||
if (-2041570812 == m_NPCInfo.nid)
|
||||
{
|
||||
BMLogger.LogError("CECNPC::SetPos,else pos="+ pos);
|
||||
}
|
||||
transform.position = pos;
|
||||
}
|
||||
public void MoveTo(cmd_object_move Cmd)
|
||||
|
||||
@@ -11,6 +11,9 @@ public class NPCVisual : MonoBehaviour
|
||||
protected CECNPC.INFO m_NPCInfo;
|
||||
[SerializeField] private Queue<string> _animationQueue = new Queue<string>();
|
||||
[SerializeField] private AnimancerState _currentState;
|
||||
private const float fadeTime = .2f;
|
||||
private const FadeMode FadeMode = Animancer.FadeMode.FixedDuration;
|
||||
|
||||
public CECNPC.INFO GetNPCINFO => m_NPCInfo;
|
||||
#if UNITY_EDITOR
|
||||
public bool isDebug;
|
||||
@@ -39,7 +42,7 @@ public class NPCVisual : MonoBehaviour
|
||||
BMLogger.LogError("HoangDev: namedAnimancerIsPlaying == null1: " + animationName);
|
||||
}
|
||||
#endif
|
||||
_currentState = namedAnimancer.TryPlay(animationName);
|
||||
_currentState = namedAnimancer.TryPlay(animationName, fadeTime);
|
||||
if (isHit)
|
||||
{
|
||||
_currentState.Events.OnEnd = () => SetHitOnEnd(cECAttackEvent);
|
||||
|
||||
@@ -20,8 +20,8 @@ namespace BrewMonster
|
||||
[SerializeField] private int id;
|
||||
[SerializeField] private bool isDebug;
|
||||
|
||||
private const float FadeTime = 0.1f;
|
||||
private const FadeMode FadeMode = Animancer.FadeMode.NormalizedDuration;
|
||||
private const float FadeTime = 100;
|
||||
private const FadeMode FadeMode = Animancer.FadeMode.FixedDuration;
|
||||
QueueActionEvent queueActionEvent;
|
||||
|
||||
private void PlayActionEventHandler(PlayActionEvent @event)
|
||||
|
||||
+113
-9
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user