// Update is called once per frame void Update() { m_mon = transform.GetComponentInChildren <MonsterController>(true); if (m_mon != null) { m_mon.isFieldMon = true; foreach (Item item in m_itemList) { m_mon.SetItem(item); } if (!m_mon.isActiveAndEnabled) { m_spawnTime += Time.deltaTime; if (m_spawnTime >= 5.0f) { m_mon.gameObject.transform.position = gameObject.transform.position; m_mon.gameObject.transform.LookAt(m_centerPos.transform); m_mon.curState = MonsterController.CurrentState.idle; m_mon.GetComponent <Animator>().speed = 1; m_mon.gameObject.SetActive(true); m_mon.Coroutine(); m_spawnTime = 0.0f; } } } }