void OnStartCameraPan() { if (m_CameraMovmentPoints.Count == 0) { m_donePanning = true; return; } Vector3 position = m_CameraMovmentPoints[0].transform.position; if (m_CameraMovmentPoints[0].gameObject == GameObject.FindGameObjectWithTag("win")) { position.y = position.y + m_CameraAtWinBagOffset; } m_CameraTF.position = Vector3.MoveTowards(m_CameraTF.position, new Vector3(position.x, position.y, m_CameraTF.position.z), m_CameraPanSpeed * Time.deltaTime); if (m_CameraMovmentPoints[0].gameObject == GameObject.FindGameObjectWithTag("win")) { OrtographicStartSize = 16; if (pooler.GetIdleActiveParticles().Count == 0 && position.y == m_CameraTF.position.y) { m_CameraMovmentPoints.RemoveAt(0); } } else if (m_CameraMovmentPoints[0].transform.position.x == m_CameraTF.position.x && m_CameraMovmentPoints[0].transform.position.y == m_CameraTF.position.y) { m_CameraMovmentPoints.RemoveAt(0); } }
void CheckLoseCondition() { timeSinceCollectedParticles = timeSinceCollectedParticles + Time.deltaTime; if (timeSinceCollectedParticles > 3 && GM.GetRemainingBags() == 0 && GameObject.FindGameObjectWithTag("bag") == null) { remaimingParticles = maxParticles - collectedParticles; // how many is supposed to be left to collect if (remaimingParticles - pooler.GetIdleActiveParticles().Count < maxParticles * 0.5f * 5) // how many remaining particles - slow particles compared to bronze limit. { if (pooler.GetIdleActiveParticles().Count < 1) { SaveLevelInfo(0, m_score, maxScore); GM.CheckEndGameConditions(); Debug.Log("Checking"); } } } //Timer when latest corn has arrivewd, if more than 5, do BIG CHECK :D:D::D:D }