本文整理汇总了C++中SimpleState::update方法的典型用法代码示例。如果您正苦于以下问题:C++ SimpleState::update方法的具体用法?C++ SimpleState::update怎么用?C++ SimpleState::update使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SimpleState
的用法示例。
在下文中一共展示了SimpleState::update方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: update
virtual void update()override
{
for (auto& uni : m_units)
{
uni.update();
}
switch (m_state.m_state)
{
case 0:
{
const bool finish = AllOf(m_units, [](const BossUnitBase& unit){ return unit.m_shot->isFinished(); });
if (finish)
{
m_state.nextState(120);
}
break;
}
case 1:
if (m_state.isFinished())
{
m_isFinish = true;
}
break;
case 2:
break;
default:
break;
}
m_state.update();
}
示例2: update
void update()
{
const double progressRate = Saturate(1.0*m_state.m_timer / (1.0*m_state.m_stateLimit));
const Vec2 focusPos = Vec2(3904, 4082);
switch (m_state.m_state)
{
case 0:
D2Camera::I()->m_pos = EaseInOut(m_startPos, focusPos, Easing::Cubic, progressRate);
m_state.checkTimerAndGoNextState(150);
break;
case 1:
D2Camera::I()->m_pos = focusPos;
m_state.checkTimerAndGoNextState(60);
break;
case 2:
D2Camera::I()->m_pos = EaseInOut(focusPos, m_startPos, Easing::Cubic, progressRate);
m_state.checkTimerAndGoNextState(60);
break;
case 3:
break;
}
m_state.update();
}