通用代码部分
基于Unity5.6.0f
//每五秒触发
float m_timer = 0;
void Update()
{
m_timer += Time.time;
if(m_timer >= 5)
{
ShowB();
m_timer = 0;
}
}
private void ShowB()
{
//do some thing
}
通用代码部分
基于Unity5.6.0f
//每五秒触发
float m_timer = 0;
void Update()
{
m_timer += Time.time;
if(m_timer >= 5)
{
ShowB();
m_timer = 0;
}
}
private void ShowB()
{
//do some thing
}