유니티 String.Format 노트
String.Format + String에 변수를 추가하는 방법 + String 뒤에 ,(콤마) 추가 후 변수를 순서대로 작성 //변수가 존재하는 경우 private int health = 100; private int level = 30; private int power = 3; public string StringFormatTest() { return string.Format("Health: {0} | Level: {1} | " + "Power: {2}", health, level, power); } void Start() { Debug.Log(StringFormatTest()); } // output: Health: 100 | Level: 30 | Power: 3 //변수가 없는 경우 + 숫자를 사..
Unity/C# note
2021. 6. 2. 01:37