// Update is called once per frame void Update() { rotateCounter += Time.deltaTime; shootCounter += Time.deltaTime; if (rotateCounter > beatPeriod) { turret.PlayRotateAnimation(); rotateCounter -= beatPeriod; } if (shootCounter > beatPeriod) { turret.PlayShootAnimation(); shootCounter -= beatPeriod; } }
// Update is called once per frame void Update() { m_fRotateCounter += Time.deltaTime; m_fShootCounter += Time.deltaTime; if (m_fRotateCounter > DF_BEAT_PERIOD) { m_kTurrent.PlayRotateAnimation(); m_fRotateCounter -= DF_BEAT_PERIOD; } if (m_fShootCounter > DF_BEAT_PERIOD) { m_kTurrent.PlayShootAnimation(); m_fShootCounter -= DF_BEAT_PERIOD; } }