void NotDelayedDestroySpawnedGameObject(T spawnedGameObject) { if (PoolSize > 0 && !_pooledGameObjects.IsFull()) { spawnedGameObject.gameObject.SetActive(false); _pooledGameObjects.Push(spawnedGameObject); } else { Destroy(spawnedGameObject.gameObject); } }
public virtual void NavigateTo(UIPage page, bool keepCache = false) { if (CurrentPage != null && CurrentPage.OnNavigatedFrom != null) { PreviousPage = CurrentPage; CurrentPage.OnNavigatedFrom.Invoke(CurrentPage); } NavigationHistory.Push(CurrentPage, true); //NavigatedFromPage = CurrentPage; CurrentPage = page; CloseOtherPages(page); page.gameObject.SetActive(true); CurrentPage.OnNavigatedTo.Invoke(CurrentPage, keepCache); }