public void ChangeToCharacterSelect() { mapSelectGameObj.SetActive(false); charSelectGameObj.SetActive(true); ScrollSnapRect scrollSnapRect = mapPanel.GetComponentInChildren <ScrollSnapRect>(); if (scrollSnapRect) { selectedMap = scrollSnapRect.GetCurrentMapName(); Debug.Log(selectedMap); } else { Debug.Log("not found scroll snap rect object to get map name"); } }
//--------------------------------------------------------------- public void ShowCorrespondIndicator() { if (scrollSnapRect.GetMapSetUpEnd()) { targetIndicatorPref.SetActive(false); string currentMapName = scrollSnapRect.GetCurrentMapName(); for (int dotNameIndex = 0; dotNameIndex < dotLocationNames.Length; dotNameIndex++) { if (dotLocationNames[dotNameIndex] == currentMapName) { targetIndicatorPref.SetActive(true); targetIndicatorPref.transform.position = transform.GetChild(dotNameIndex).position; return; } } } }