ย  ย  public static DataController GetInstance()

ย  ย  {

ย  ย  ย  ย  if (instance == null)

ย  ย  ย  ย  {

ย  ย  ย  ย  ย  ย  instance = FindObjectOfType<DataController>();


ย  ย  ย  ย  ย  ย  if (instance == null)

ย  ย  ย  ย  ย  ย  {

ย  ย  ย  ย  ย  ย  ย  ย  GameObject container = new GameObject("DataCOntroller");


ย  ย  ย  ย  ย  ย  ย  ย  instance = container.AddComponent<DataController>();

ย  ย  ย  ย  ย  ย  }

ย  ย  ย  ย  }

ย  ย  ย  ย  return instance;

ย  ย  }


์•„๋‹ˆ๋ฉด ๋ชป์งœ์„œ ํ•„์š”ํ• ๋•Œ๋งˆ๋‹ค ๊ฒ€์ƒ‰ํ•จ