c# 3

C#을 사용하여 Unity 폴더의 파일 목록 가져오기

OS : Window 11 Version : 2021.3.16f1 유니티에서 폴더의 파일 목록을 가져오는 방법에 대해서 알아보겠습니다. 먼저 게임 오브젝트를 하나만들고 거기에 FileList라는 이름으로 컴포넌트를 추가합니다. 그리고 아래처럼 소스코드를 작성합니다. using System.Collections; using System.Collections.Generic; using UnityEngine; using System.IO; public class fileList : MonoBehaviour { // Start is called before the first frame update void Start() { DirectoryInfo di = new DirectoryInfo(Application...

유니티 2023.03.11

C#(Unity) - 로컬 IP 읽어오는 법

OS : Window 10 C#에서 로컬 IP를 출력하는 방법입니다. 유니티에서도 동일하게 사용 가능합니다. 유니티에서 출력하실 땐 Console.WriteLine이 아닌 print나 Debug.Log로 변경하셔야 합니다. using System.Net; //추가해줘야 합니다. IPHostEntry host = Dns.GetHostEntry(Dns.GetHostName()); foreach (IPAddress ip in host.AddressList) { if (ip.AddressFamily == AddressFamily.InterNetwork) { Console.WriteLine(ip.ToString()); } }

프로그래밍/C# 2023.03.10

유니티에서 http 로컬 서버의 file목록 가져오기

OS : Window 10 Version : 2021.3.6f1 ftp서버에서 목록의 목록을 확인해야할 때, 사용하는 방법입니다. 웹 크롤링과 같은 원리로 생각하시면 될 것 같습니다 using System; using System.Collections; using System.Collections.Generic; using System.IO; using System.Net; using System.Text.RegularExpressions; using UnityEngine; using static System.Net.WebRequestMethods; public class CountFTPFile : MonoBehaviour { private void Start() { string uri = "http:/..

유니티 2023.03.09
반응형