public void SetInit(int worldIndex, int stageIndex) { this.worldIndex = worldIndex; this.stageIndex = stageIndex; isUnLocked = StageList.IsUnLocked(worldIndex, stageIndex); onClick.AddListener(() => OnClick()); transform.Find("Title").GetComponent <Text>().text = RomanNumber.Roman(stageIndex + 1); if (isUnLocked) { transform.Find("LockImage").gameObject.SetActive(false); } else { transform.Find("LockImage").gameObject.SetActive(true); } }
public void ListStages(int worldIndex) { for (int i = 0; i < stageSelectButtons.Length; i++) { stageSelectButtons[i].SetInit(0, i); } Vector2 buttonLocalPos = Vector2.zero; for (int i = 0; i < stageSelectButtons.Length; i++) { if (StageList.IsUnLocked(0, i))//잠겨있음 { buttonLocalPos = stageSelectButtons[i].GetComponent <RectTransform>().anchoredPosition; } } this.GetComponent <RectTransform>().anchoredPosition = -buttonLocalPos; }