本文整理匯總了C#中StorySystem.StoryInstance.GetMessageTriggerTime方法的典型用法代碼示例。如果您正苦於以下問題:C# StoryInstance.GetMessageTriggerTime方法的具體用法?C# StoryInstance.GetMessageTriggerTime怎麽用?C# StoryInstance.GetMessageTriggerTime使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類StorySystem.StoryInstance
的用法示例。
在下文中一共展示了StoryInstance.GetMessageTriggerTime方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: ExecCommand
protected override bool ExecCommand(StoryInstance instance, long delta)
{
bool ret = false;
Scene scene = instance.Context as Scene;
if (null != scene) {
if (m_StartTime <= 0) {
long startTime = GameFramework.TimeUtility.GetLocalMilliseconds();
m_StartTime = startTime;
}
bool triggered = false;
for (int i = 0; i < m_MsgIds.Count; i++) {
long time = instance.GetMessageTriggerTime(m_MsgIds[i].Value);
if (time > m_StartTime) {
triggered = true;
break;
}
}
if (triggered) {
string varName = m_SetVar.Value;
object varVal = m_SetVal.Value;
instance.SetVariable(varName, varVal);
} else {
int timeout = m_TimeoutVal.Value;
int curTime = m_CurTime;
m_CurTime += (int)delta;
if (timeout <= 0 || curTime <= timeout) {
ret = true;
} else {
string varName = m_TimeoutSetVar.Value;
object varVal = m_TimeoutSetVal.Value;
instance.SetVariable(varName, varVal);
}
}
}
return ret;
}