μ 체 κΈ
![[Unity] νμ© κ°λ₯ν AI μ½λ© μλΉμ€ 1νΈ](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FbgKFss%2Fbtr5NKFB3Cs%2FtqdSegve2IyrBr4efB6xl1%2Fimg.png)
[Unity] νμ© κ°λ₯ν AI μ½λ© μλΉμ€ 1νΈ
νμ© κ°λ₯ν AI μ½λ© μλΉμ€ 1νΈ 1. ChatGPT ChatGPTλ₯Ό μ΄μ©νμ¬ μ λν° C# μ€ν¬λ¦½νΈλ₯Ό μ§λλ‘ νμ©ν μ μλ€. https://openai.com/blog/chatgpt?utm_source=youtube&utm_medium=social&utm_campaign=unitylive-jan_unitytips_aicoding Introducing ChatGPT We’ve trained a model called ChatGPT which interacts in a conversational way. The dialogue format makes it possible for ChatGPT to answer followup questions, admit its mistakes, challenge inc..
[C#] struct λμ classλ₯Ό μ¨μΌ ν λ
struct λμ classλ₯Ό μ¨μΌ ν λ κ°λ¨ν λ°μ΄ν° ꡬ쑰λ₯Ό ννν λ μ’ μ’ structλ₯Ό μ¬μ©νκ³€ νλ€. μ΄λ ν¨μ μμμ μ¬μ©λλ structλ Value νμ μΌλ‘ μ€νμ μμ±λκ³ , classλ Reference νμ μΌλ‘ μΈμ€ν΄μ€κ° νμ μμ±λλ€. μ΄λ¬ν ꡬ쑰μ μΈ μ°¨μ΄λ λλ‘ λ²κ·Έλ₯Ό λ°μμν€κ³€ νλ€. μλμ κ°μ μμ κ° μλ€. struct Employee { public string Name { get; set; } public int Salary { get; set; } } class HR { public void RaiseSalary(Employee emp) { emp.Salary = emp.Salary + 1000; } } Employee emp = new Employee(); emp.Nam..
[C#] string κ°μ²΄ μ¬μ©μμ νν νλ μ€μ
string κ°μ²΄ μ¬μ©μμ νν νλ μ€μ ν λ©μλ μμ λ‘컬 λ³μλ€μ κ·Έ λ©μλκ° λλ λ ν΄μ νκ² λλ€. Value νμ μ λ³μλ ν¨μ 리ν΄κ³Ό λμμ μ€νμμ ν΄μ λκ³ , Reference νμ μ λ³μλ GCμ μν΄ νμμ μλ ν΄μ λλ€. μ¬κΈ°μ νν νλ μ€μ μ€ νλλ λ νΌλ°μ€ νμ μ κ°μ²΄λ₯Ό λΆνμνκ² λ무 λ§μ΄ λ§λλ κ²μ΄λ€. μλ₯Ό λ€μ΄ μλ μμ λ string κ°μ²΄λ₯Ό nκ° μ© κ³μ μμ±νκ³ μλ€. public string Get1ToN_Bad(int n) { string s = ""; for (int i = 1; i
[C# 8.0] μλ‘μ΄ κΈ°λ₯ (3) - using μ μΈ, λ λ³ν© ν λΉμ, ꡬ쑰체 μ½κΈ° μ μ© λ©€λ²
C# 8.0μ μλ‘μ΄ κΈ°λ₯ 5. using μ μΈ using μ μΈμ using λ€μ μλ λ³μκ° usingμ λλ¬μΌ λ²μλ₯Ό λ²μ΄λ κ²½μ° Dispose νλλ‘ μ»΄νμΌλ¬μκ² μ§μνκ² λλ€. Disposeλ λ©λͺ¨λ¦¬ κ΄λ¦¬λ₯Ό μν΄ μ¬μ©λλ©° λ μ΄μ μ΄ μ€λΈμ νΈλ₯Ό μ°μ§ μκ³ , κ΄λ ¨ 리μμ€λ₯Ό μ 리νλ€λ λ»μ΄λ€. λ©μλκ° λλ λ Disposeλ₯Ό μλ νΈμΆνλ€. private void GetDataCS8() { using var reader = new StreamReader("src.txt"); string data = reader.ReadToEnd(); Debug.WriteLine(data); // μ¬κΈ°μ Dispose() νΈμΆλ¨ } 6. λ λ³ν© ν λΉμ(Null Coalescing Assignment) νν NULL..
[C# 8.0] μλ‘μ΄ κΈ°λ₯ (2) - Nullable Reference Type, μΈλ±μ±κ³Ό μ¬λΌμ΄μ±
C# 8.0μ μλ‘μ΄ κΈ°λ₯ 3. Nullable Reference Type μ΄μ λ²μ μμλ reference νμ μ nullμ ν λΉν μ μμ΄ Null Reference Exceptionμ΄ μμ£Ό λ°μλκ³€ νλ€. κ·Έλμ C# 8.0μμλ reference νμ μ nullμ ν λΉνλ©΄ μ»΄νμΌλ¬κ° κ²½κ³ νλ κΈ°λ₯μ μΆκ°λμλ€. reference νμ μ κΈ°λ³Έμ μΌλ‘ nullμ λ£μ μ μλ Non-nullable Reference Typeμ΄ λκ³ , NULLμ νμ©νκΈ° μν΄μλ λ νΌλ°μ€ νμ λ€μ λ¬Όμν(?)λ₯Ό λΆμ¬ Nullable Reference Typeμμ νμν΄μΌ νλ€. Nullable Reference Type κΈ°λ₯μ λν΄νΈλ‘ Disable λμ΄ μμΌλ©° μ¬μ©νκΈ° μν΄μλ νλ‘μ νΈ λ 벨μ΄λ νμΌ λ 벨, νΉμ μ..
[C# 8.0] μλ‘μ΄ κΈ°λ₯ (1) - λν΄νΈ μΈν°νμ΄μ€ λ©€λ², ν¨ν΄ 맀μΉ
C# 8.0μ μλ‘μ΄ κΈ°λ₯ λν΄νΈ μΈν°νμ΄μ€ λ©€λ²(Default Inteface Members) ν¨ν΄ λ§€μΉ Nullable Reference Type μΈλ±μ±κ³Ό μ¬λΌμ΄μ± λΉλκΈ° μ€νΈλ¦Ό using μ μΈ λ λ³ν© ν λΉμ ꡬ쑰체 μ½κΈ° μ μ© λ©€λ² μ μ λ‘컬 ν¨μ λ¬Έμμ΄ λ³΄κ° ν ν°κ³Ό @ ν ν° μμ Unmanaged constructed type https://www.csharpstudy.com/Latest/CS8-def-itf-mem.aspx C# 8 λν΄νΈ μΈν°νμ΄μ€ λ©€λ² - C# νλ‘κ·Έλλ° λ°°μ°κΈ° (Learn C# Programming) C# 8 : λν΄νΈ μΈν°νμ΄μ€ λ©€λ² κ΅¬ν (Default Inteface Members) μ§κΈκΉμ§ (C# 8.0 μ΄μ ) C#μμ μΈν°νμ΄μ€λ₯Ό νλ² λ°°ν¬ν ν, κ·Έ μΈν°νμ΄μ€λ₯Ό ..