fix animation processing
This commit is contained in:
@@ -15,7 +15,7 @@ MonoBehaviour:
|
||||
m_DefaultGroup: 712e3991f28e549e7a56ee582a977810
|
||||
m_currentHash:
|
||||
serializedVersion: 2
|
||||
Hash: 2b260a6f4d09eb87199ab9c362c7be67
|
||||
Hash: 00000000000000000000000000000000
|
||||
m_OptimizeCatalogSize: 0
|
||||
m_BuildRemoteCatalog: 0
|
||||
m_CatalogRequestsTimeout: 0
|
||||
|
||||
@@ -1390,7 +1390,7 @@ MonoBehaviour:
|
||||
_ActionOnDisable: 0
|
||||
_PlayAutomatically: 1
|
||||
_Animations:
|
||||
- {fileID: 7400000, guid: 90cc8644824b249a38b2379b6251ce34, type: 2}
|
||||
- {fileID: 7400000, guid: 153bbba8a7a5243a698dc273553eca2a, type: 2}
|
||||
- {fileID: 7400000, guid: 8665cc7619ce84512a3c2de61fd63c98, type: 2}
|
||||
- {fileID: 7400000, guid: 8826e424623004a4b8ed903ef7744ab0, type: 2}
|
||||
- {fileID: 7400000, guid: 102f1710aedd54d2dbbcca62840b9a7e, type: 2}
|
||||
|
||||
@@ -130,6 +130,9 @@ namespace BrewMonster.Managers
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -15,7 +15,6 @@ public class CECNPCMan : IMsgHandler
|
||||
private Dictionary<int, CECNPC> m_NPCTab = new Dictionary<int, CECNPC>(512);
|
||||
private Dictionary<int, int> m_UkNPCTab = new Dictionary<int, int>(32);
|
||||
|
||||
|
||||
List<CECNPC> m_aDisappearNPCs = new List<CECNPC>(32);
|
||||
public int HandlerId => (int)MANAGER_INDEX.MAN_NPC;
|
||||
|
||||
@@ -285,7 +284,10 @@ public class CECNPCMan : IMsgHandler
|
||||
private bool OnMsgNPCStopMove(ECMSG msg)
|
||||
{
|
||||
cmd_object_stop_move pCmd = EC_Utility.ByteArrayToStructure<cmd_object_stop_move>((byte[])msg.dwParam1);
|
||||
|
||||
if(-2041571143 == pCmd.id)
|
||||
{
|
||||
BMLogger.Log("HoangDev: OnMsgNPCStopMove NPCID: " + pCmd.id);
|
||||
}
|
||||
CECNPC pNPC = SeekOutNPC(pCmd.id);
|
||||
if (pNPC)
|
||||
pNPC.StopMoveTo(pCmd);
|
||||
|
||||
@@ -14,7 +14,7 @@ using UnityEngine;
|
||||
|
||||
public class CECObject : MonoBehaviour
|
||||
{
|
||||
|
||||
|
||||
protected static int ALPHA_HASH = Shader.PropertyToID("_Alpha");
|
||||
protected Quaternion targetRotation;
|
||||
protected Quaternion startRotation; // Store starting rotation for Slerp
|
||||
@@ -111,13 +111,13 @@ public class CECObject : MonoBehaviour
|
||||
m_bAdjustOrient = false;
|
||||
}
|
||||
// Set destination orientation of model
|
||||
public void SetDestDirAndUp(Vector3 vDir, Vector3 vUp, float dwTime)
|
||||
public void SetDestDirAndUp(A3DVECTOR3 vDir, Vector3 vUp, float dwTime)
|
||||
{
|
||||
m_bAdjustOrient = true;
|
||||
m_dwOrientTime = dwTime;
|
||||
m_dwOrientTimeCnt = 0;
|
||||
startRotation = transform.rotation; // Store current rotation as start
|
||||
targetRotation = Quaternion.LookRotation(vDir, Vector3.up);
|
||||
targetRotation = Quaternion.LookRotation(EC_Utility.ToVector3(vDir), Vector3.up);
|
||||
}
|
||||
|
||||
// Calculate distance between this object and specified position
|
||||
@@ -184,7 +184,7 @@ public class CECObject : MonoBehaviour
|
||||
{
|
||||
vDir.Normalize();
|
||||
}
|
||||
SetDestDirAndUp(vDir, g_vAxisY, timeturn);
|
||||
SetDestDirAndUp(EC_Utility.ToA3DVECTOR3(vDir), g_vAxisY, timeturn);
|
||||
}
|
||||
protected virtual void Update()
|
||||
{
|
||||
|
||||
@@ -46,7 +46,7 @@ public class CECMonster : CECNPC
|
||||
SetSelectable(false);
|
||||
|
||||
transform.position = EC_Utility.ToVector3(info.pos);
|
||||
transform.forward = EC_Utility.glb_DecompressDirH(info.dir);
|
||||
transform.forward = EC_Utility.ToVector3(EC_Utility.glb_DecompressDirH(info.dir));
|
||||
|
||||
StartWork((int)WorkType.WT_NOTHING, (int)WorkID.WORK_STAND);
|
||||
return true;
|
||||
|
||||
@@ -9,10 +9,11 @@ using System;
|
||||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
using static Unity.Burst.Intrinsics.X86.Avx;
|
||||
|
||||
public class CECNPC : CECObject
|
||||
{
|
||||
protected INFO m_NPCInfo;
|
||||
[SerializeField] protected INFO m_NPCInfo;
|
||||
protected private uint m_dwStates;
|
||||
protected private uint m_dwStates2;
|
||||
protected private Vector3 m_vServerPos;
|
||||
@@ -25,7 +26,7 @@ public class CECNPC : CECObject
|
||||
protected float m_fDistToHostH;
|
||||
protected OtherPlayer_Move_Info m_cdr;
|
||||
protected float m_fTouchRad = 1f;
|
||||
protected Vector3 m_vMoveDir;
|
||||
protected A3DVECTOR3 m_vMoveDir;
|
||||
protected int m_iPassiveMove;
|
||||
protected bool m_bStopMove;
|
||||
protected bool m_bStartFight;
|
||||
@@ -39,7 +40,7 @@ public class CECNPC : CECObject
|
||||
protected CECCounter m_TransCnt = new CECCounter();
|
||||
protected int m_StartDisappearCnt;
|
||||
protected bool m_bAboutToDie;
|
||||
protected Vector3 m_vStopDir;
|
||||
protected A3DVECTOR3 m_vStopDir;
|
||||
protected ROLEEXTPROP m_ExtProps;
|
||||
protected ROLEBASICPROP m_BasicProps;
|
||||
protected CECNPCModelPolicy m_pNPCModelPolicy;
|
||||
@@ -49,6 +50,8 @@ public class CECNPC : CECObject
|
||||
public UINPC m_npcUI;
|
||||
[SerializeField] protected float m_fMoveSpeed;
|
||||
[SerializeField] protected CharacterController _characterController;
|
||||
[SerializeField] protected bool isDebug;
|
||||
[SerializeField] protected NPCVisual npcVisual;
|
||||
|
||||
protected static CECStringTab m_ActionNames;
|
||||
|
||||
@@ -95,7 +98,11 @@ public class CECNPC : CECObject
|
||||
: (info.state & PlayerNPCState.GP_STATE_NPC_SWIM) != 0 ? Move_environment.MOVEENV_WATER
|
||||
: Move_environment.MOVEENV_GROUND);
|
||||
|
||||
var npcVisual = GetComponent<NPCVisual>();
|
||||
npcVisual = GetComponent<NPCVisual>();
|
||||
if (npcVisual == null)
|
||||
{
|
||||
BMLogger.LogError("HoangDev npcVisual");
|
||||
}
|
||||
m_pNPCModelPolicy.SetNpcVisual(npcVisual);
|
||||
m_npcUI = GetComponentInChildren<UINPC>();
|
||||
|
||||
@@ -493,10 +500,10 @@ public class CECNPC : CECObject
|
||||
}
|
||||
else if (MovingTo(dwDeltaTime))
|
||||
{
|
||||
/* if (!IsDirFixed())
|
||||
{
|
||||
SetDestDirAndUp(m_vStopDir, g_vAxisY, 150);
|
||||
}*/
|
||||
if (!IsDirFixed())
|
||||
{
|
||||
SetDestDirAndUp((m_vStopDir), g_vAxisY, 150);
|
||||
}
|
||||
|
||||
WorkFinished((int)WorkID.WORK_MOVE);
|
||||
|
||||
@@ -507,11 +514,11 @@ public class CECNPC : CECObject
|
||||
public void Release()
|
||||
{
|
||||
// Release current skill if it exists
|
||||
/* if (m_pCurSkill)
|
||||
{
|
||||
delete m_pCurSkill;
|
||||
m_pCurSkill = NULL;
|
||||
}*/
|
||||
/*if (m_pCurSkill)
|
||||
{
|
||||
delete m_pCurSkill;
|
||||
m_pCurSkill = NULL;
|
||||
}*/
|
||||
|
||||
// Clear extend states before model is released
|
||||
/* ClearShowExtendStates();
|
||||
@@ -593,7 +600,6 @@ public class CECNPC : CECObject
|
||||
}
|
||||
else // đang move bình thường
|
||||
{
|
||||
|
||||
float dist = (m_vServerPos - curPos).magnitude;
|
||||
|
||||
if (IsLag(dist))
|
||||
@@ -603,21 +609,22 @@ public class CECNPC : CECObject
|
||||
transform.position = m_vServerPos;
|
||||
_characterController.enabled = true;
|
||||
|
||||
m_vStopDir = transform.forward;
|
||||
m_vStopDir = EC_Utility.ToA3DVECTOR3(transform.forward);
|
||||
return true;
|
||||
}
|
||||
|
||||
Vector3 dir = m_vMoveDir.normalized;
|
||||
Vector3 moveDelta = dir * m_fMoveSpeed * deltaTime;
|
||||
A3DVECTOR3 dir = m_vMoveDir;
|
||||
dir.Normalize();
|
||||
var vDir = EC_Utility.ToVector3(dir);
|
||||
Vector3 moveDelta = vDir * m_fMoveSpeed * deltaTime;
|
||||
if (_characterController == null)
|
||||
{
|
||||
BMLogger.LogError(" CECNPC.MovingTo _characterController == null " + gameObject.name);
|
||||
BMLogger.LogError("CECNPC.MovingTo _characterController == null " + gameObject.name);
|
||||
}
|
||||
_characterController.Move(moveDelta);
|
||||
// Thêm xoay theo trục Y
|
||||
FaceDirectionSmooth(dir, 10f, deltaTime);
|
||||
FaceDirectionImmediate(vDir);
|
||||
}
|
||||
|
||||
return reachedDestination;
|
||||
}
|
||||
/// <summary>
|
||||
@@ -899,12 +906,18 @@ public class CECNPC : CECObject
|
||||
}
|
||||
public void StopMoveTo(cmd_object_stop_move cmd)
|
||||
{
|
||||
/* if (IsDead())
|
||||
return;*/
|
||||
if (IsDead())
|
||||
return;
|
||||
|
||||
int iMoveMode = cmd.move_mode & (int)GPMoveMode.GP_MOVE_MASK;
|
||||
|
||||
m_vMoveDir = EC_Utility.ToVector3(cmd.dest) - transform.position;
|
||||
m_vMoveDir = (cmd.dest) - EC_Utility.ToA3DVECTOR3(transform.position);
|
||||
if (-2041571143 == m_NPCInfo.nid)
|
||||
{
|
||||
BMLogger.LogError($"CECNPC::StopMoveTo, MoveDir=" + m_vMoveDir);
|
||||
BMLogger.LogError($"CECNPC::StopMoveTo, cmd.dest=" + cmd.dest);
|
||||
BMLogger.LogError($"CECNPC::StopMoveTo, EC_Utility.ToA3DVECTOR3(transform.position)=" + EC_Utility.ToA3DVECTOR3(transform.position));
|
||||
}
|
||||
m_bStopMove = true;
|
||||
m_fMoveSpeed = EC_Utility.FIX8TOFLOAT(cmd.sSpeed);
|
||||
m_vServerPos = EC_Utility.ToVector3(cmd.dest);
|
||||
@@ -918,17 +931,18 @@ public class CECNPC : CECObject
|
||||
|
||||
if (IsDirFixed())
|
||||
{
|
||||
// hướng cố định, set luôn
|
||||
transform.forward = m_vStopDir;
|
||||
transform.forward = EC_Utility.ToVector3(m_vStopDir);
|
||||
}
|
||||
|
||||
float fDist = m_vMoveDir.normalized.magnitude; // Normalize() trả về float trong C++, ở đây cần xử lý lại
|
||||
m_vMoveDir.Normalize();
|
||||
|
||||
float fDist = m_vMoveDir.Normalize();
|
||||
if (-2041571143 == m_NPCInfo.nid)
|
||||
{
|
||||
BMLogger.LogError("HoangDEv iMoveMode" + iMoveMode);
|
||||
}
|
||||
// Trong các trường hợp dưới thì kéo NPC về đích
|
||||
if (iMoveMode != (int)GPMoveMode.GP_MOVE_RETURN &&
|
||||
iMoveMode != (int)GPMoveMode.GP_MOVE_PUSH &&
|
||||
iMoveMode != (int)GPMoveMode.GP_MOVE_PULL)
|
||||
iMoveMode != (int)GPMoveMode.GP_MOVE_PUSH &&
|
||||
iMoveMode != (int)GPMoveMode.GP_MOVE_PULL)
|
||||
{
|
||||
bool bPull = false;
|
||||
|
||||
@@ -940,11 +954,15 @@ public class CECNPC : CECObject
|
||||
else if (fDist < 1.0f)
|
||||
{
|
||||
// case 2
|
||||
Vector3 vDirH = m_vMoveDir;
|
||||
A3DVECTOR3 vDirH = (m_vMoveDir);
|
||||
vDirH.y = 0.0f;
|
||||
vDirH.Normalize();
|
||||
if (Vector3.Dot(vDirH, m_vStopDir) < 0.7f)
|
||||
if (DotProduct(vDirH, (m_vStopDir)) < 0.7f)
|
||||
bPull = true;
|
||||
if (-2041571143 == m_NPCInfo.nid)
|
||||
{
|
||||
BMLogger.LogError($"vDirH={vDirH}, m_vStopDir= {m_vStopDir}, HoangDEv DotProduct =" + DotProduct(vDirH, (m_vStopDir)));
|
||||
}
|
||||
}
|
||||
else if (iMoveMode == (int)GPMoveMode.GP_MOVE_BLINK)
|
||||
{
|
||||
@@ -955,18 +973,47 @@ public class CECNPC : CECObject
|
||||
if (bPull)
|
||||
{
|
||||
SetPos(EC_Utility.ToVector3(cmd.dest));
|
||||
if (!IsDirFixed())
|
||||
{
|
||||
SetDestDirAndUp(m_vStopDir, g_vAxisY, 150);
|
||||
}
|
||||
if (-2041571143 == m_NPCInfo.nid)
|
||||
{
|
||||
BMLogger.LogError($"cmd.dest={cmd.dest}");
|
||||
}
|
||||
WorkFinished((int)WorkID.WORK_MOVE);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
m_cdr.bTraceGround = true;
|
||||
|
||||
if ((cmd.move_mode & (int)GPMoveMode.GP_MOVE_AIR) != 0)
|
||||
{
|
||||
m_iMoveEnv = (int)MoveEnvironment.MOVEENV_AIR;
|
||||
m_cdr.bTraceGround = false;
|
||||
}
|
||||
else if ((cmd.move_mode & (int)GPMoveMode.GP_MOVE_WATER) != 0)
|
||||
{
|
||||
m_iMoveEnv = (int)MoveEnvironment.MOVEENV_WATER;
|
||||
m_cdr.bTraceGround = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_iMoveEnv = (int)MoveEnvironment.MOVEENV_GROUND;
|
||||
|
||||
if (iMoveMode == (int)GPMoveMode.GP_MOVE_FALL || iMoveMode == (int)GPMoveMode.GP_MOVE_FLYFALL)
|
||||
m_cdr.bTraceGround = false;
|
||||
}
|
||||
|
||||
if (!IsDirFixed() && m_iPassiveMove == 0)
|
||||
{
|
||||
Vector3 vDir = m_vMoveDir;
|
||||
A3DVECTOR3 vDir = m_vMoveDir;
|
||||
vDir.y = 0.0f;
|
||||
if (vDir != Vector3.zero)
|
||||
if (!vDir.IsZero())
|
||||
{
|
||||
vDir.Normalize();
|
||||
SetDestDirAndUp(vDir, g_vAxisY, 150);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -980,6 +1027,10 @@ public class CECNPC : CECObject
|
||||
}
|
||||
}
|
||||
}
|
||||
public static float DotProduct(A3DVECTOR3 v1, A3DVECTOR3 v2)
|
||||
{
|
||||
return v1.x * v2.x + v1.y * v2.y + v1.z * v2.z;
|
||||
}
|
||||
public bool GetCHAABB(ref A3DAABB aabb)
|
||||
{
|
||||
return m_pNPCModelPolicy.GetCHAABB(ref aabb);
|
||||
@@ -992,10 +1043,10 @@ public class CECNPC : CECObject
|
||||
{
|
||||
if (Cmd.use_time == 0)
|
||||
return;
|
||||
var dest = EC_Utility.ToVector3(Cmd.dest);
|
||||
m_vServerPos = dest;
|
||||
m_vMoveDir = dest - transform.position;
|
||||
float fDist = m_vMoveDir.magnitude; // lấy độ dài ban đầu
|
||||
var dest = Cmd.dest;
|
||||
m_vServerPos = EC_Utility.ToVector3( dest);
|
||||
m_vMoveDir = dest - EC_Utility.ToA3DVECTOR3( transform.position);
|
||||
float fDist = m_vMoveDir.Magnitude(); // lấy độ dài ban đầu
|
||||
m_vMoveDir.Normalize(); // giả sử Normalize() trả về độ dài trước khi chuẩn hóa
|
||||
|
||||
// If destination position is too far, forcely pull player
|
||||
@@ -1194,6 +1245,10 @@ public class CECNPC : CECObject
|
||||
}
|
||||
public void StartWork_Stand(uint dwParam)
|
||||
{
|
||||
if (isDebug)
|
||||
{
|
||||
BMLogger.LogError("StartWork_Stand ");
|
||||
}
|
||||
if (!m_bStartFight)
|
||||
{
|
||||
if (IsMonsterOrPet())
|
||||
@@ -1335,6 +1390,10 @@ public class CECNPC : CECObject
|
||||
}
|
||||
m_npcUI.gameObject.SetActive(false);
|
||||
}
|
||||
if (isDebug)
|
||||
{
|
||||
BMLogger.LogError("PlayModelAction iAction :" + iAction);
|
||||
}
|
||||
m_pNPCModelPolicy.PlayModelAction(iAction, bRestart, null);
|
||||
}
|
||||
bool IsDisappearing() { return m_DisappearCnt.GetCounter() != 0 ? true : false; }
|
||||
@@ -1347,6 +1406,7 @@ public class CECNPC : CECObject
|
||||
}
|
||||
public INFO GetNPCInfo() { return m_NPCInfo; }
|
||||
|
||||
[Serializable]
|
||||
public struct INFO
|
||||
{
|
||||
public int nid; // NPC id
|
||||
|
||||
@@ -175,8 +175,17 @@ public class CECNPCModelDefaultPolicy
|
||||
if (iAction == (int)NPCActionIndex.ACT_DIE || iAction == (int)NPCActionIndex.ACT_NPC_DIE)
|
||||
{
|
||||
}
|
||||
|
||||
if (_npcVisual.isDebug)
|
||||
{
|
||||
BMLogger.LogError("CECNPCModelDefaultPolicy::PlayModelAction iAction :" + iAction);
|
||||
BMLogger.LogError("GetActionName(iAction) :" + GetActionName(iAction));
|
||||
}
|
||||
result = _npcVisual.TryPlayAction(GetActionName(iAction), cECAttackEvent);
|
||||
if (_npcVisual.isDebug)
|
||||
{
|
||||
|
||||
BMLogger.LogError("result :" + result);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ public class CECNPCServer : CECNPC
|
||||
m_npcUI.SetName(m_strName);
|
||||
}
|
||||
|
||||
transform.forward = EC_Utility.glb_DecompressDirH(info.dir);
|
||||
transform.forward = EC_Utility.ToVector3(EC_Utility.glb_DecompressDirH(info.dir));
|
||||
transform.position = EC_Utility.ToVector3(info.pos);
|
||||
|
||||
StartWork((int)WorkType.WT_NOTHING, (int)WorkID.WORK_STAND);
|
||||
|
||||
@@ -13,42 +13,50 @@ public class NPCVisual : MonoBehaviour
|
||||
[SerializeField] private AnimancerState _currentState;
|
||||
public CECNPC.INFO GetNPCINFO => m_NPCInfo;
|
||||
#if UNITY_EDITOR
|
||||
[SerializeField] bool isDebug;
|
||||
public void DEBUG(string text)
|
||||
{
|
||||
if (!isDebug) return;
|
||||
BMLogger.LogError(text);
|
||||
}
|
||||
public bool isDebug;
|
||||
#endif
|
||||
public bool TryPlayAction(string animationName, CECAttackEvent cECAttackEvent, bool isHit = false, bool bRestart = true)
|
||||
{
|
||||
#if UNITY_EDITOR
|
||||
DEBUG("HoangDev: TryPlayAction: " + animationName);
|
||||
if (isDebug)
|
||||
{
|
||||
BMLogger.LogError("HoangDev: TryPlayAction: " + animationName);
|
||||
}
|
||||
|
||||
#endif
|
||||
if (namedAnimancer == null) return false;
|
||||
#if UNITY_EDITOR
|
||||
DEBUG("HoangDev: namedAnimancer == null: " + animationName);
|
||||
if (isDebug)
|
||||
{
|
||||
BMLogger.LogError("HoangDev: namedAnimancer == null: " + animationName);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (namedAnimancer.IsPlaying(animationName)) return false;
|
||||
#if UNITY_EDITOR
|
||||
DEBUG("HoangDev: namedAnimancerIsPlaying == null1: " + animationName);
|
||||
if (isDebug)
|
||||
{
|
||||
BMLogger.LogError("HoangDev: namedAnimancerIsPlaying == null1: " + animationName);
|
||||
}
|
||||
#endif
|
||||
_currentState = namedAnimancer.TryPlay(animationName);
|
||||
if (isHit)
|
||||
{
|
||||
_currentState.Events.OnEnd = ()=>SetHitOnEnd(cECAttackEvent);
|
||||
_currentState.Events.OnEnd = () => SetHitOnEnd(cECAttackEvent);
|
||||
}
|
||||
#if UNITY_EDITOR
|
||||
if (_currentState != null)
|
||||
DEBUG("HoangDev: _currentState != null1: " + _currentState.Clip.name);
|
||||
if (isDebug)
|
||||
{
|
||||
if (_currentState != null)
|
||||
BMLogger.LogError("HoangDev: _currentState != null1: " + _currentState.Clip.name);
|
||||
}
|
||||
#endif
|
||||
return _currentState != null;
|
||||
}
|
||||
private void SetHitOnEnd(CECAttackEvent cECAttackEvent)
|
||||
{
|
||||
cECAttackEvent.m_bSignaled = true;
|
||||
}
|
||||
}
|
||||
public void InitNPCEventDoneHandler(CECNPC.INFO iNFO)
|
||||
{
|
||||
m_NPCInfo = iNFO;
|
||||
@@ -64,16 +72,22 @@ public class NPCVisual : MonoBehaviour
|
||||
private void OnClearComActFlagEvent(ClearComActFlagEvent @event)
|
||||
{
|
||||
#if UNITY_EDITOR
|
||||
if (_currentState != null)
|
||||
DEBUG("HoangDev: OnClearComActFlagEvent _currentState:" + _currentState.Clip.name);
|
||||
if (isDebug)
|
||||
{
|
||||
if (_currentState != null)
|
||||
BMLogger.LogError("HoangDev: OnClearComActFlagEvent _currentState:" + _currentState.Clip.name);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if UNITY_EDITOR
|
||||
foreach (var state in _animationQueue)
|
||||
if (isDebug)
|
||||
{
|
||||
DEBUG("HoangDev: OnClearComActFlagEvent state:" + state);
|
||||
foreach (var state in _animationQueue)
|
||||
{
|
||||
BMLogger.LogError("HoangDev: OnClearComActFlagEvent state:" + state);
|
||||
}
|
||||
BMLogger.LogError("HoangDev: OnClearComActFlagEvent");
|
||||
}
|
||||
DEBUG("HoangDev: OnClearComActFlagEvent");
|
||||
#endif
|
||||
_animationQueue.Clear();
|
||||
}
|
||||
@@ -109,7 +123,10 @@ public class NPCVisual : MonoBehaviour
|
||||
if (_currentState.NormalizedTime < 1f) return;
|
||||
string animName = _animationQueue.Dequeue();
|
||||
#if UNITY_EDITOR
|
||||
DEBUG("HoangDev: PlayNext: " + animName);
|
||||
if (isDebug)
|
||||
{
|
||||
BMLogger.LogError("HoangDev: PlayNext: " + animName);
|
||||
}
|
||||
#endif
|
||||
_currentState = namedAnimancer.TryPlay(animName);
|
||||
}
|
||||
|
||||
@@ -432,7 +432,6 @@ namespace CSNetwork
|
||||
case CommandID.OBJECT_STOP_MOVE:
|
||||
{
|
||||
int id1 = GPDataTypeHelper.FromBytes<int>(pDataBuf);
|
||||
BMLogger.LogError($"### GameDataSend: STOP MOVE ID: {id1}");
|
||||
|
||||
if (ISPLAYERID(id1))
|
||||
{
|
||||
@@ -441,7 +440,6 @@ namespace CSNetwork
|
||||
}
|
||||
else if (ISNPCID(id1))
|
||||
{
|
||||
BMLogger.LogError($"### GameDataSend: NPC STOP MOVE ID: {id1}");
|
||||
EC_ManMessage.PostMessage(EC_MsgDef.MSG_NM_NPCSTOPMOVE, (int)MANAGER_INDEX.MAN_NPC, 0, pDataBuf,
|
||||
pCmdHeader);
|
||||
}
|
||||
|
||||
@@ -85,8 +85,8 @@ namespace BrewMonster
|
||||
public Skill390Stub() : base(390)
|
||||
{
|
||||
cls = 0;
|
||||
name = "真·劈空掌";
|
||||
nativename = "真·劈空掌";
|
||||
name = "真・劈空掌";
|
||||
nativename = "真・劈空掌";
|
||||
icon = "劈空掌1.dds";
|
||||
max_level = 1;
|
||||
type = 1;
|
||||
@@ -108,17 +108,10 @@ namespace BrewMonster
|
||||
long_range = 0;
|
||||
restrict_corpse = 0;
|
||||
allow_forms = 1;
|
||||
effect = "1劈空掌.sgc";
|
||||
doenchant = 1;
|
||||
dobless = 1;
|
||||
commoncooldown = 0;
|
||||
commoncooldowntime = 0;
|
||||
restrict_weapons.Add(182);
|
||||
restrict_weapons.Add(0);
|
||||
effect = "";
|
||||
range = new Range();
|
||||
range.type = 0;
|
||||
pre_skills = new Dictionary<uint, int>();
|
||||
pre_skills.Add(60, 10);
|
||||
#if SKILL_SERVER
|
||||
statestub.Add(new State1());
|
||||
statestub.Add(new State2());
|
||||
@@ -155,8 +148,14 @@ namespace BrewMonster
|
||||
|
||||
#if SKILL_SERVER
|
||||
public int GetEnmity(Skill skill) => 3000;
|
||||
public bool StateAttack(Skill skill) => true;
|
||||
public bool BlessMe(Skill skill) => true;
|
||||
public bool StateAttack(Skill skill)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
public bool BlessMe(Skill skill)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
public bool TakeEffect(Skill skill) => true;
|
||||
public float GetEffectdistance(Skill skill) => 12.5f;
|
||||
public int GetAttackspeed(Skill skill) => 10;
|
||||
|
||||
@@ -163,3 +163,6 @@ namespace BrewMonster
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -161,3 +161,6 @@ namespace BrewMonster
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -100,3 +100,6 @@ namespace BrewMonster
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -476,7 +476,7 @@ Transform:
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6780952369966265306}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0.020765202, y: 0.6585355, z: -0.01818329, w: 0.7520433}
|
||||
m_LocalRotation: {x: 0.026024496, y: 0.5726356, z: -0.0181917, w: 0.8191949}
|
||||
m_LocalPosition: {x: 0, y: 1, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
@@ -525,7 +525,7 @@ GameObject:
|
||||
- component: {fileID: 2542060226037108388}
|
||||
- component: {fileID: -3520322077839857420}
|
||||
- component: {fileID: -2400324395862947468}
|
||||
- component: {fileID: 8595541918946480801}
|
||||
- component: {fileID: 6956701954572561772}
|
||||
m_Layer: 0
|
||||
m_Name: MonsterPrefab
|
||||
m_TagString: Untagged
|
||||
@@ -561,11 +561,17 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: 2cd22b82fc76bed46ac948cef9c7119d, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_NPCInfo:
|
||||
nid: 0
|
||||
tid: 0
|
||||
vis_tid: 0
|
||||
m_iMMIndex: 0
|
||||
m_idAttackTarget: 0
|
||||
m_npcUI: {fileID: 0}
|
||||
m_fMoveSpeed: 0
|
||||
_characterController: {fileID: -2400324395862947468}
|
||||
isDebug: 0
|
||||
npcVisual: {fileID: 0}
|
||||
--- !u!114 &-3520322077839857420
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -606,8 +612,8 @@ CharacterController:
|
||||
m_SkinWidth: 0.08
|
||||
m_MinMoveDistance: 0.001
|
||||
m_Center: {x: 0, y: 1, z: 0}
|
||||
--- !u!65 &8595541918946480801
|
||||
BoxCollider:
|
||||
--- !u!136 &6956701954572561772
|
||||
CapsuleCollider:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
@@ -624,8 +630,10 @@ BoxCollider:
|
||||
m_IsTrigger: 0
|
||||
m_ProvidesContacts: 0
|
||||
m_Enabled: 1
|
||||
serializedVersion: 3
|
||||
m_Size: {x: 2, y: 2, z: 2}
|
||||
serializedVersion: 2
|
||||
m_Radius: 0.8
|
||||
m_Height: 1
|
||||
m_Direction: 1
|
||||
m_Center: {x: 0, y: 1, z: 0}
|
||||
--- !u!1 &7614570036441268122
|
||||
GameObject:
|
||||
|
||||
@@ -66,12 +66,12 @@ public static class EC_Utility
|
||||
Marshal.FreeHGlobal(ptr);
|
||||
}
|
||||
}
|
||||
public static Vector3 glb_DecompressDirH(byte byDir)
|
||||
public static A3DVECTOR3 glb_DecompressDirH(byte byDir)
|
||||
{
|
||||
const float fInter = 360.0f / 256.0f;
|
||||
float fRad = Mathf.Deg2Rad * (byDir * fInter);
|
||||
|
||||
Vector3 v;
|
||||
A3DVECTOR3 v;
|
||||
v.x = Mathf.Cos(fRad);
|
||||
v.z = Mathf.Sin(fRad);
|
||||
v.y = 0.0f;
|
||||
|
||||
+9
-626
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user