비주얼 스튜디오 유니코드로 저장하기

.editorconfig로 파일명으로 프로젝트 폴더 안에 저장한다. root = true [*] charset = utf-8 다음과 같이 저장한다.
using UnityEngine;
using System.Collections;
public class Singleton: MonoBehaviour
{
public static Singleton Instance;
//Awake is always called before any Start functions
void Awake()
{
if (Instance)
{
DestroyImmediate(gameObject);
}
else
{
Instance = this;
DontDestroyOnLoad(gameObject);
}
}
}
case 2 :
public class MyClass
{
private static MyClass _instance;
public static MyClass Instance
{
get
{
if (!_instance)
{
_instance = GameObject.FindObjectOfType(typeof(MyClass));
if (!_instance)
{
GameObject container = new GameObject();
container.name = "MyClassContainer";
_instance = container.AddComponent(typeof(MyClass)) as MyClass;
}
}
return _instance;
}
}
}
댓글
댓글 쓰기