public void GetCellDestination(CellTransitionDestination.DestinationTag destinationTag, out CellTransitionDestination cellTransitionDestination) { for (int i = 0; i < cellTransitionDestinations.Length; i++) { if (cellTransitionDestinations[i].destinationTag == destinationTag) { cellTransitionDestination = cellTransitionDestinations[i]; return; } } cellTransitionDestination = null; Debug.LogError("해당 목적지가 현재 셀에 없습니다"); }
public void SetCell(Cell newCell, CellTransitionDestination.DestinationTag destinationTag) { if (newCell == null || !m_CellCache.Contains(newCell)) { Debug.LogWarning("new cell information has not been set"); return; } if (m_CurrentCell) { m_PreviousCell = m_CurrentCell; } m_CurrentCell = newCell; m_CurrentCell.gameObject.SetActive(true); m_CurrentCell.GetCellDestination(destinationTag, out m_LastEnteringDestination); }
private IEnumerator Transition(string newSceneName, CellTransitionDestination.DestinationTag destinationTag, TransitionPoint.TransitionType transitionType = TransitionPoint.TransitionType.DifferentZone) { m_Transitioning = true; yield return(StartCoroutine(ScreenFader.FadeSceneOut(ScreenFader.FadeType.Black))); yield return(SceneManager.LoadSceneAsync(newSceneName)); cellController = FindObjectOfType <CellController>(); screenManager = FindObjectOfType <ScreenManager>(); parallaxScroller = FindObjectOfType <ParallaxScroller>(); var publisher = FindObjectOfType <Publisher>(); publisher.GainOrReleaseControl(false); cellController.GetRootCell(out rootCell); cellController.SetCell(rootCell, destinationTag); publisher.SetObservers(false, true, cellController.LastEnteringDestination.locations); screenManager.autoCameraSetup.SetMainConfinerBound(rootCell.confinerCollider); yield return(StartCoroutine(ScreenFader.FadeSceneIn())); publisher.GainOrReleaseControl(true); m_Transitioning = false; }