private void Awake() { businessCloseFade.onCompleted.AddListener(() => { onEditorModeStarted.Invoke(); }); }
private void Update() { timer += Time.deltaTime; if (!GameObject.Find("ApplePrefab(Clone)")) { SpawnFood(); } if (timer > waitTime) { score++; timer -= waitTime; scoreEvent.Invoke(score); } }
private IEnumerator BusinessTimer() { var businessSystems = FindObjectsOfType <BusinessSystem>(); float currentTime = 0f; RemainedBusinessTime = 0f; while (currentTime < gameModeData.businessTime) { yield return(null); currentTime += Time.smoothDeltaTime; RemainedBusinessTime = gameModeData.businessTime - currentTime; } RemainedBusinessTime = 0; onBusinessTimeOvered.Invoke(); int remainedCustomerCount = 0; while (true) { foreach (var businessSystem in businessSystems) { remainedCustomerCount += businessSystem.CustomerCount; } if (remainedCustomerCount == 0) { break; } else { remainedCustomerCount = 0; yield return(null); } } day++; businessCloseFade.gameObject.SetActive(true); businessCloseFade.StartAnimation(); }
public void StartBusiness() { onBusinessModeStarted.Invoke(); StartCoroutine("BusinessTimer"); }