
게임매니저에서 스테이지 별로 LevelData를 불러 오도록 설정
using UnityEngine;
public class LevelLoader : MonoBehaviour
{
public PlayerController Player;
public GameObject Cinemachine;
private void Start()
{
GameMangerController.Instance.Player = Player;
GameMangerController.Instance.CinemachineInstance = Cinemachine;
}
}
스크립트를 작성하고, LevelData에 컴포넌트로 설정

프리팹 인스턴스에서 수정을 하고, 프리팹 본체에 오버라이드 하기 위해서 Overrides를 누르고 Apply All을 누르면 기존 본체에 설정이 변경됨.
LevelLoader.cs와 GameManagerController.cs 에서
두 스크립트의 Awake()함수의 우선순위 때문에 오류 발생
->script execution order로 순서 지정

방법1.

방법2.


LevelData를 삭제하면 GameManager 오브젝트에서 일부가 사라져서 None이 뜬다.
프리팹을 만들면서 기존에 설정해둔것이 사라짐
-> 왜? Why? LevelData를 관리하기 위해 플레이어 및 스테이지에 관련된 오브젝트를 프리팹으로 만들고 삭제 했기 때문에

GameMangerController에 빈 곳이 있지만, 실행하면 LevelLoader가 실행해, 데이터를 로더해서 작동 됨


새로운 씬을 만들기 위해, LeveSelect 씬을 새로 제작,
Canvas -> Panel -> Text 생성
Panel -> ScrollView 생성 
stretch조절해서 비율맞추고, 우리는 Vertical 스크롤은 필요 없기때문에 삭제