Merge pull request 'feature/chanting-gfx-logic' (#429) from feature/chanting-gfx-logic into develop
Reviewed-on: https://git.pthub.vn/Unity/perfect-world-unity/pulls/429
This commit is contained in:
@@ -67,12 +67,11 @@ namespace BrewMonster.Scripts
|
||||
public override bool Tick(float dwDeltaTime)
|
||||
{
|
||||
base.Tick(dwDeltaTime * 1000);
|
||||
//BMLogger.LogError($" m_OverTimeCnt m_dwCounter:{m_OverTimeCnt.m_dwCounter}, m_dwPeriod:{m_OverTimeCnt.m_dwPeriod} ");
|
||||
if (m_OverTimeCnt.IncCounter(dwDeltaTime * 1000))
|
||||
//BMLogger.Log($" m_OverTimeCnt m_dwCounter:{m_OverTimeCnt.m_dwCounter}, m_dwPeriod:{m_OverTimeCnt.m_dwPeriod} ");
|
||||
if (m_OverTimeCnt.IncCounter(dwDeltaTime * 1000,out float fCounter,out float fPeriod))
|
||||
{
|
||||
BMLogger.LogError($" m_OverTimeCnt finished ");
|
||||
m_bFinished = true; }
|
||||
|
||||
m_bFinished = true;
|
||||
}
|
||||
if (m_idTarget != 0)
|
||||
{
|
||||
m_pHost.TurnFaceTo(m_idTarget);
|
||||
@@ -99,12 +98,12 @@ namespace BrewMonster.Scripts
|
||||
m_idTarget = 0;
|
||||
}
|
||||
// Copy work data
|
||||
public virtual bool CopyData(CECHPWork pWork)
|
||||
public override bool CopyData(CECHPWork pWork)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
// Cancel work
|
||||
public virtual void Cancel()
|
||||
public override void Cancel()
|
||||
{
|
||||
m_pHost.TurnFaceTo(0);
|
||||
base.Cancel();
|
||||
|
||||
@@ -114,8 +114,12 @@ public class GFX_BINDING : FX_BINDING_BASE
|
||||
if (main.loop)
|
||||
{
|
||||
// Let the effect run one full loop cycle, then stop emitting. / 再播完一整圈循环后停发粒子
|
||||
//Magic number for trailing effect, I dunno what it mean.
|
||||
float oneLoop = .75f;
|
||||
// Longest main.duration under this GFX (loop period per particle system). / 取挂点下所有粒子的 duration 最大值作为一整圈时长
|
||||
float oneLoop = 0f;
|
||||
foreach (ParticleSystem psChild in go.GetComponentsInChildren<ParticleSystem>(true))
|
||||
oneLoop = Mathf.Max(oneLoop, psChild.main.duration);
|
||||
if (oneLoop > 2f)
|
||||
oneLoop = 2f;
|
||||
await UniTask.Delay(TimeSpan.FromSeconds(oneLoop), delayType, cancellationToken: ct);
|
||||
if (_ps != null && _ps.IsAlive(true))
|
||||
_ps.Stop(true, ParticleSystemStopBehavior.StopEmitting);
|
||||
@@ -596,8 +600,22 @@ public class A3DCombActDynData
|
||||
}
|
||||
public bool IsActionStopped()
|
||||
{
|
||||
return m_pAct.m_ActLst.Count == 0 ||
|
||||
(m_pAct.m_nLoops != -1 && m_nCurLoop >= m_pAct.m_nLoops);
|
||||
if(m_pAct.IsLooping())
|
||||
{
|
||||
Debug.Log($" m_pAct.m_nLoops == -1 m_nCurLoop:{m_nCurLoop} ");
|
||||
return false;
|
||||
}
|
||||
if(m_nCurLoop >= m_pAct.m_nLoops)
|
||||
{
|
||||
Debug.Log($" m_nCurLoop >= m_pAct.m_nLoops m_nCurLoop:{m_nCurLoop} m_pAct.m_nLoops:{m_pAct.m_nLoops} ");
|
||||
return true;
|
||||
}
|
||||
if(m_pAct.m_ActLst.Count == 0)
|
||||
{
|
||||
Debug.Log($" m_pAct.m_ActLst.Count == 0 m_nCurLoop:{m_nCurLoop} m_pAct.m_ActLst.Count:{m_pAct.m_ActLst.Count} ");
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
void LoopCurAct(ACTION_INFO pCur, uint dwDeltaTime)
|
||||
{
|
||||
@@ -1494,7 +1512,7 @@ public class CECModel
|
||||
|
||||
public int GetCurActionUserData(int channel = 0)
|
||||
{
|
||||
var returnValue = -1;
|
||||
var returnValue = 0;
|
||||
var nodeCh0 = m_ChannelActs[channel].GetHighestRankNode();
|
||||
if (nodeCh0 != null)
|
||||
returnValue = nodeCh0.m_pActive.GetUserData();
|
||||
|
||||
Reference in New Issue
Block a user