private async void Start() { //Initial Checks { const string environmentTag = "Environment"; parent = GameObject.FindGameObjectWithTag(environmentTag).transform; Debug.Assert(parent != null, $"Could not find parent target GameObject with tag \"{environmentTag}\"", this); } if (streamParentPrefab == null) { Debug.LogError($"{nameof(streamParentPrefab)} was unassigned", this); return; } var defaultAccount = AccountManager.GetDefaultAccount(); if (defaultAccount == null) { Debug.Log("Please set a default account in the Speckle Manager desktop application", this); //TODO proper exceptions that are handled by UI return; } //Setup List <SpeckleStream> streamList = await SpeckleStreams.List(); if (!streamList.Any()) { Debug.Log("There are no streams in your account, please create one online."); //TODO proper exceptions that are handled by UI return; } foreach (SpeckleStream s in streamList) { StreamFromID.Add(s.id, s); } OnReadyToReceive?.Invoke(defaultAccount.userInfo, defaultAccount.serverInfo); //If there is already a model imported GameObject environment = GameObject.FindGameObjectWithTag("Environment"); if (environment.GetComponentInChildren <Renderer>(false) != null) { OnBusyChange?.Invoke(false); } }
private void UpdateBusy(bool receiverBusy) { IsBusy = receiverBusy || parent.GetComponentsInChildren <Transform>().Length <= 1; // 0 (+ 1 for the parent transform) OnBusyChange?.Invoke(IsBusy); }