void Update() { if (m_Heath.death) { return; } switch (m_State) { case State.Start: m_Timer -= Time.deltaTime; if (m_Timer <= 0f) { GotoSteel(); } break; case State.SteelMoving: OnStateSteelMoving(); break; case State.BackMoving: if (!m_Movement.isMoving) { if (m_TakingGem != null) { m_TakingGem.Steel(); } m_State = State.Win; } break; case State.Win: gameObject.SetActive(false); break; } }