debug
This commit is contained in:
@@ -15,45 +15,22 @@ public class NPCVisual : MonoBehaviour
|
||||
private const FadeMode FadeMode = Animancer.FadeMode.FixedDuration;
|
||||
|
||||
public CECNPC.INFO GetNPCINFO => m_NPCInfo;
|
||||
#if UNITY_EDITOR
|
||||
public bool isDebug;
|
||||
#endif
|
||||
public bool TryPlayAction(string animationName, CECAttackEvent cECAttackEvent, bool isHit = false, bool bRestart = true)
|
||||
{
|
||||
#if UNITY_EDITOR
|
||||
if (isDebug)
|
||||
{
|
||||
BMLogger.LogError("HoangDev: TryPlayAction: " + animationName);
|
||||
}
|
||||
BMLogger.LogMono(this, "HoangDev: TryPlayAction: " + animationName);
|
||||
|
||||
#endif
|
||||
if (namedAnimancer == null) return false;
|
||||
#if UNITY_EDITOR
|
||||
if (isDebug)
|
||||
{
|
||||
BMLogger.LogError("HoangDev: namedAnimancer == null: " + animationName);
|
||||
}
|
||||
#endif
|
||||
BMLogger.LogMono(this, "HoangDev: namedAnimancer == null: " + animationName);
|
||||
|
||||
if (namedAnimancer.IsPlaying(animationName)) return false;
|
||||
#if UNITY_EDITOR
|
||||
if (isDebug)
|
||||
{
|
||||
BMLogger.LogError("HoangDev: namedAnimancerIsPlaying == null1: " + animationName);
|
||||
}
|
||||
#endif
|
||||
BMLogger.LogMono(this, "HoangDev: namedAnimancerIsPlaying == null1: " + animationName);
|
||||
_currentState = namedAnimancer.TryPlay(animationName, fadeTime);
|
||||
if (isHit)
|
||||
{
|
||||
_currentState.Events.OnEnd = () => SetHitOnEnd(cECAttackEvent);
|
||||
}
|
||||
#if UNITY_EDITOR
|
||||
if (isDebug)
|
||||
{
|
||||
if (_currentState != null)
|
||||
BMLogger.LogError("HoangDev: _currentState != null1: " + _currentState.Clip.name);
|
||||
}
|
||||
#endif
|
||||
if (_currentState != null)
|
||||
BMLogger.LogMono(this, "HoangDev: _currentState != null1: " + _currentState.Clip.name);
|
||||
return _currentState != null;
|
||||
}
|
||||
private void SetHitOnEnd(CECAttackEvent cECAttackEvent)
|
||||
@@ -74,24 +51,14 @@ public class NPCVisual : MonoBehaviour
|
||||
}
|
||||
private void OnClearComActFlagEvent(ClearComActFlagEvent @event)
|
||||
{
|
||||
#if UNITY_EDITOR
|
||||
if (isDebug)
|
||||
{
|
||||
if (_currentState != null)
|
||||
BMLogger.LogError("HoangDev: OnClearComActFlagEvent _currentState:" + _currentState.Clip.name);
|
||||
}
|
||||
#endif
|
||||
if (_currentState != null)
|
||||
BMLogger.LogError("HoangDev: OnClearComActFlagEvent _currentState:" + _currentState.Clip.name);
|
||||
|
||||
#if UNITY_EDITOR
|
||||
if (isDebug)
|
||||
foreach (var state in _animationQueue)
|
||||
{
|
||||
foreach (var state in _animationQueue)
|
||||
{
|
||||
BMLogger.LogError("HoangDev: OnClearComActFlagEvent state:" + state);
|
||||
}
|
||||
BMLogger.LogError("HoangDev: OnClearComActFlagEvent");
|
||||
BMLogger.LogMono(this,"HoangDev: OnClearComActFlagEvent state:" + state);
|
||||
}
|
||||
#endif
|
||||
BMLogger.LogMono(this,"HoangDev: OnClearComActFlagEvent");
|
||||
_animationQueue.Clear();
|
||||
}
|
||||
|
||||
@@ -125,12 +92,7 @@ public class NPCVisual : MonoBehaviour
|
||||
animName1 = _animationQueue.Peek();
|
||||
if (_currentState.NormalizedTime < 1f) return;
|
||||
string animName = _animationQueue.Dequeue();
|
||||
#if UNITY_EDITOR
|
||||
if (isDebug)
|
||||
{
|
||||
BMLogger.LogError("HoangDev: PlayNext: " + animName);
|
||||
}
|
||||
#endif
|
||||
BMLogger.LogMono(this,"HoangDev: PlayNext: " + animName);
|
||||
_currentState = namedAnimancer.TryPlay(animName);
|
||||
}
|
||||
private void OnDestroy()
|
||||
|
||||
Reference in New Issue
Block a user