public void FinishBuilding() { if (!_buildingFinished) { _buildingFinished = true; buildingFinishedUI.SetActive(true); cameraAnimator.enabled = true; Invoke(nameof(OnLoadRacingViewFinished), 3f); DeactivateMinifigs(); OnBuildingFinished?.Invoke(); } }
private IEnumerator BuildInProgress() { if (ReadyToBuild == false) { yield return(new WaitWhile(() => ReadyToBuild == false)); } while (GroupsToBuild.Count != 0) { GameObject currentGroup = GroupsToBuild[0]; GroupsToBuild.Remove(currentGroup); for (int i = 0; i < currentGroup.transform.childCount; i++) { currentGroup.transform.GetChild(i).gameObject.SetActive(true); yield return(null);// new WaitForSeconds(0.1f); } } OnBuildingFinished.Invoke(); }
void FinishBuilding() { buildingRender.material.DOColor(stateColors[1], "_EmissionColor", 0.1f).OnComplete(() => buildingRender.material.DOColor(stateColors[0], "_EmissionColor", .5f)); OnBuildingFinished?.Invoke(); }