void Update() { if (m_bMoving) { float fPerc = Mathf.Min(1.0f, (Time.time - m_timeStart) / m_duration); transform.position = Vector3.Lerp(m_initPos, m_dest, fPerc); if (fPerc >= 1.0f) { m_bMoving = false; } } if (m_linkedBaby != null) { if (!m_bBabyAte) { if (!m_linkedBaby.IsEating()) //Baby just ate { m_bBabyAte = true; MoveTo(Gameplay_Normal.Instance.GetPos_EatOut(), 0.2f); if (m_success) { //Drop prize float fRand = Random.Range(0.0f, 1.0f); float fProb = Gameplay_Normal.Instance.GetBabyData(m_linkedBaby.baby).GetPrizeProbability() * (Gameplay_Normal.Instance.IsPrizeSeasonActive() ? 2.0f : 1.0f); if (fRand <= fProb) { if (BabiesPool.Instance.GetPrize(m_linkedBaby.baby)) { BabiesPool.Instance.GetPrize(m_linkedBaby.baby).Dropped(m_linkedBaby.transform.position); } } } } } else { if (!IsMoving()) //Going Out { transform.localScale = Vector3.one; BabiesPool.Instance.ReturnToPool(m_linkedBaby.transform); CloudPool.Instance.AddObject(transform); m_linkedBaby = null; } } } }