Fix annimation not loop

This commit is contained in:
Tran Hai Nam
2026-05-11 11:00:04 +07:00
parent 6cebb9079d
commit dda7b1c0db
3 changed files with 82 additions and 50 deletions
@@ -127,6 +127,8 @@ namespace ModelViewer.Common
public int m_nMinLoops;
public int m_nMaxLoops;
public bool IsInfinite() { return m_nMinLoops == -1 || m_nMaxLoops == -1; }
public int CalcLoopNum() { return IsInfinite() ? -1 : Random.Range(m_nMinLoops, m_nMaxLoops); }
public bool Load(FileStream fileStream, StreamReader file, uint dwVersion)
{
bool isBinary = fileStream != null;
@@ -174,6 +176,21 @@ namespace ModelViewer.Common
}
}
public class ACTIONDYN_DATA
{
private int m_nLoopNum;
ACTION_INFO m_pInfo;
public ACTIONDYN_DATA(int nLoopNum = 0, ACTION_INFO pInfo = null)
{
m_nLoopNum = nLoopNum;
m_pInfo = pInfo;
}
public int GetLoopNum() { return m_nLoopNum; }
public ACTION_INFO GetActInfo() { return m_pInfo; }
public int GetTimeSpan() { return 1/*m_pInfo.GetTimeSpan()*/; }
public int GetTotalTime() { return GetLoopNum() * GetTimeSpan(); }
}
[System.Serializable]
public class EVENT_INFO
{
@@ -487,7 +504,7 @@ namespace ModelViewer.Common
public string m_strName;
public int m_nLoops;
public bool IsLooping()
{
if (m_ActLst.Count == 0)