Get it on Google Play


Wm뮤 :: 'Unity/C#' 카테고리의 글 목록

블로그 이미지
불펌때문에 드래그 방지 건것가지고
99% 다 공유되는 지식 가져와서 쓰는 글 아니냐 누가 보면 자기 지식 훔쳐가는줄 자기도 다 베껴온거일텐데
같은 소리 할거면 꾸역꾸역 블로그 찾아오지 말고 AI나 쓰쇼.
세상에 없는게 많아서 손수 연구하고 정리해줬더니 이런 소리나 들어야 합니까?
모카쨩
@ahzkwid

Recent Comment

Archive


2025. 7. 3. 01:48 Unity/C#

 

먼저 구독관리를 해야 활성화 된다

 

 

 

 

 

1. 주석으로 코드 생성

 

주석으로 만들 코드를 설명하고 엔터치면 코드가 나온다

 

 

이 상태에서 TAP을 누르면 입력된다

 

 

 

 

 

2. 질문하기

 

 

 

 

질문 입력

 

 

해당되는 코드 입력

 

 

 

전송

 

 

근데 너무 빡대가리라 GPT 쓰는게 낫다

 

'Unity > C#' 카테고리의 다른 글

SharpPcap을 이용한 패킷분석 프로그램 제작  (0) 2025.06.24
유니티 오브젝트 경로 관련  (0) 2024.08.23
OnSceneGUI 관련코드  (0) 2024.07.11
posted by 모카쨩
2025. 6. 24. 16:15 Unity/C#

 

 

 

 

 

 

먼저 와이어샤크를 통해 패킷분석을 먼저 한다

그래야 좀 편하다

https://wmmu.tistory.com/entry/%EC%99%80%EC%9D%B4%EC%96%B4%EC%83%A4%ED%81%AC%EB%A5%BC-%EC%9D%B4%EC%9A%A9%ED%95%9C-%ED%8C%A8%ED%82%B7%EB%B6%84%EC%84%9D

 

와이어샤크를 이용한 패킷분석

와이어샤크를 깐다https://www.wireshark.org/download.html Wireshark • DownloadWireshark: The world's most popular network protocol analyzerwww.wireshark.org 그다음 찾고자 하는 패킷을 필터링 하기위해 IP와 포트를 얻어낼것

wmmu.tistory.com

 

 

 

 

 

 

 

 

 

 

 

윈폼 프로젝트 셋업을 한다

 

SharpPcap Nuget을 설치

 

샘플들은 이곳에서 볼수있다

https://github.com/dotpcap/sharppcap

 

GitHub - dotpcap/sharppcap: Official repository - Fully managed, cross platform (Windows, Mac, Linux) .NET library for capturing

Official repository - Fully managed, cross platform (Windows, Mac, Linux) .NET library for capturing packets - dotpcap/sharppcap

github.com

 

 

 

 

샘플코드

https://gist.github.com/ahzkwid/f0d9f01fdf41e7d3cfd4f6ace0438f92

using System.Diagnostics;
using SharpPcap;
using SharpPcap.LibPcap;

namespace Ahzkwid
{
    public class PacketCapture
    {
        private LibPcapLiveDevice[] devices;

        public PacketCapture()
        {

            var devices = LibPcapLiveDeviceList.Instance.ToList();

            // IP가 있는 장치만 필터링해서 재할당
            //devices = devices.FindAll(dev => dev.Addresses.Any(a => a.Addr.ipAddress.AddressFamily == AddressFamily.InterNetwork));

            devices = devices
            .FindAll(dev =>
            {
                var lowerName = dev.Description.ToLower();
                if (lowerName.Contains("loopback") && lowerName.Contains("capture"))
                {
                    return false;
                }
                return true;
            });

            Debug.WriteLine("장치 목록");
            for (int i = 0; i < devices.Count; i++)
            {
                var device = devices[i];
                var address = device.Addresses.Select(a => a.Addr);
                Debug.WriteLine($"[{i}] {device.Description} - Address: {string.Join(", ", address)}");
            }

            this.devices = devices.ToArray();
        }

        public void Start()
        {
            Debug.WriteLine("패킷 캡처 시작.");
            foreach (var device in devices)
            {
                device.Open(DeviceModes.Promiscuous, 1000);
                device.OnPacketArrival += (sender, e) =>
                {
                    var data = e.GetPacket().Data;
                    Debug.WriteLine($"{System.DateTime.Now} : {BitConverter.ToString(data).Replace("-", " ")}");
                };
                device.StartCapture();
            }
        }

        public void Stop()
        {
            foreach (var device in devices)
            {
                device.StopCapture();
                device.Close();
            }
            Debug.WriteLine("패킷 캡처 종료.");
        }
    }
}

 

위 코드를 넣고

 

아래처럼 넣어주면 된다

public partial class Form1 : Form
{
    private Ahzkwid.PacketCapture packetCapture;
    public Form1()
    {
        InitializeComponent();

        packetCapture = new Ahzkwid.PacketCapture();
        packetCapture.Start();
    }

    private void Form1_FormClosing(object sender, FormClosingEventArgs e)
    {
        packetCapture?.Stop();
    }
}

 

 

 

그러면 아래와 같이 패킷들이 나오고

입맛에 맞게 필터링을 걸거나 추출하면 된다

 

 

 

 



SharpPcap으로 만든것

https://wmmu.tistory.com/entry/%EB%AA%A8%EB%B9%84%EB%85%B8%EA%B8%B0-%ED%97%88%EC%88%98%EC%95%84%EB%B9%84-%EB%AF%B8%ED%84%B0%EA%B8%B0-%EC%82%AC%EC%9A%A9%EB%B2%95

 

모비노기 허수아비 미터기 사용법

https://www.youtube.com/watch?v=RUM0Tktf2zU 이 미터기는 허수아비에서만 사용가능하며 장비와 딜사이클 세팅을 위해 쓴다 아래 링크로 들어간다 https://github.com/zjvlwid/MobiMeter/releases Releases · zjvlwid/MobiMeterCo

wmmu.tistory.com

 

 

 

'Unity > C#' 카테고리의 다른 글

Copilot 사용법  (0) 2025.07.03
유니티 오브젝트 경로 관련  (0) 2024.08.23
OnSceneGUI 관련코드  (0) 2024.07.11
posted by 모카쨩
2024. 8. 23. 06:30 Unity/C#


Root를 제외한 경로반환

v1 ~ v3

더보기


가령 Root/armature/Hips는 /armature/Hips가 된다

string ArmaturePath(Transform bone)
{
    var rootName = bone.transform.root.name;
    var hierarchyPath = bone.transform.GetHierarchyPath();
    return hierarchyPath.Substring(rootName.Length, hierarchyPath.Length - rootName.Length);
}

 

 


Root를 제외한 경로반환 v2 (상대경로)

인자를 하나 더 받고 안정성을 높였다

https://gist.github.com/ahzkwid/c89b626c0e7bace5cc317901b524672e

static string RelativePath(Transform target, Transform root = null)
{
    var rootName = "";
    var hierarchyPath = "";


    if (root != null)
    {
        try
        {
            rootName = SearchUtils.GetHierarchyPath(root.gameObject, false);

        }
        catch (System.Exception ex)
        {
            Debug.LogError(ex);
            Debug.LogError(root.ToString() + "nothing root");
            //Debug.LogError(bone.name + "는 root가 없음");
            throw;
        }
    }
    try
    {
        //hierarchyPath = bone.GetHierarchyPath();
        hierarchyPath = SearchUtils.GetHierarchyPath(target.gameObject, false);
    }
    catch (System.Exception ex)
    {
        Debug.LogError(ex);
        Debug.LogError(target.ToString() + "nothing GetHierarchyPath");
        throw;
    }

    var startIndex = rootName.Length;

    return hierarchyPath.Substring(startIndex, hierarchyPath.Length - startIndex);
}

 

v3

static string RelativePath(Transform target, Transform root = null)
{
    var rootName = "";
    var hierarchyPath = "";


    if (root != null)
    {
        try
        {
            rootName = SearchUtils.GetHierarchyPath(root.gameObject, false);

        }
        catch (System.Exception ex)
        {
            Debug.LogError(ex);
            Debug.LogError(root.ToString() + "nothing root");
            //Debug.LogError(bone.name + "는 root가 없음");
            throw;
        }
    }
    try
    {
        //hierarchyPath = bone.GetHierarchyPath();
        hierarchyPath = SearchUtils.GetHierarchyPath(target.gameObject, false);
    }
    catch (System.Exception ex)
    {
        Debug.LogError(ex);
        Debug.LogError(target.ToString() + "nothing GetHierarchyPath");
        throw;
    }

    var startIndex = rootName.Length;

    if (rootName.Length > hierarchyPath.Length)
    {
        Debug.LogWarning("rootName.Length > hierarchyPath.Length");
        Debug.LogWarning($"{rootName} > {hierarchyPath}");
        return null;
    }

    if (hierarchyPath.Substring(0, rootName.Length) != rootName)
    {
        Debug.LogWarning("hierarchyPath.Substring(0, rootName.Length) != rootName");
        Debug.LogWarning($"{rootName} != {hierarchyPath}.Substring(0, rootName.Length)");
        return null;
    }

    try
    {
        return hierarchyPath.Substring(startIndex, hierarchyPath.Length - startIndex);
    }
    catch (System.Exception ex)
    {
        Debug.LogError(ex);
        Debug.LogError($"{hierarchyPath} - {rootName}");
        throw;
    }
}

 

 

v4

경우에 따라 앞에 슬래시는 없애도 된다

var relativePath = "/"+Path.GetRelativePath(rootpath, path);

 

 

 

 

 

 

하이어라키 경로 반환

var path = SearchUtils.GetHierarchyPath(gameObject, false);

 

 

 

패스 병합

Replace 붙은 이유는 유니티는 '/'를 쓰는데 일부 로직에서 '\'를 인식 못하기 때문

var path = Path.Join(parentPath, childPath).Replace("\\", "/");

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

'Unity > C#' 카테고리의 다른 글

SharpPcap을 이용한 패킷분석 프로그램 제작  (0) 2025.06.24
OnSceneGUI 관련코드  (0) 2024.07.11
유니티 라이트 레졸루션 개별설정  (0) 2024.05.12
posted by 모카쨩
2024. 7. 11. 19:30 Unity/C#

 

 

 

 

 

OnDrawGizmos처럼 상시동작하는점이 비슷하지만

OnDrawGizmos는 기즈모 드로우 옵션이 켜져있을때에만 동작하므로

기능코드는 가급적 OnSceneGUI에 넣는것이 좋다

 

 

 

1. Static에서 FindObjectsOfType를 이용해 가져와서 처리하는 방식

gist : https://gist.github.com/ahzkwid/3294e9d4cf3980ae2d1c135123db145c

public class SampleClass : MonoBehaviour
{
  static void OnSceneGUI(SceneView sceneView)
  {
      foreach (var sampleClass in FindObjectsOfType<SampleClass>())
      {
          if (sceneView.camera != null)
          {
              var sceneCamera = sceneView.camera;
              //CameraCode
          }
          //otherCode
      }
  }
}
//OtherSample: https://gist.github.com/ahzkwid/6647d3aec625afe96c54bb38b2671c72

 

 


2. SceneView.duringSceneGui에서 이벤트를 받는 방식

gist : https://gist.github.com/ahzkwid/315febfe26ef88adfa537bcfd6f6d49e

이 방식은 가볍지만 안정성은 1번에 비해서는 떨어진다

유니티 에디터 버그로 인해 Enable과 Disable이 제대로 호출 안 되거나 하는경우

이벤트가 중복호출되거나 등록 실패하는등...

일반적으로는 이 방식을 쓰고 무조건 동작해야 하는 너무 중요한 코드는 위방식을 쓰는게 좋다

[ExecuteInEditMode]
public class SampleClass : MonoBehaviour
{
    void OnEnable()
    {
        SceneView.duringSceneGui += OnSceneGUI;
    }

    void OnDisable()
    {
        SceneView.duringSceneGui -= OnSceneGUI;
    }
    void OnSceneGUI(SceneView sceneView)
    {
        //code
    }
}

 

 

 

 

 

 

 

 

3. EditorApplication.hierarchyWindowItemOnGUI 혼합예제

원문링크 : https://forum.unity.com/threads/solved-how-to-start-draganddrop-action-so-that-sceneview-and-hierarchy-accept-it-like-with-prefabs.822531/

아래 코드는 내가 만든게 아니고 위 링크에서 가져와 간소화 한것일뿐이다

[ExecuteInEditMode]
public class SampleClass : MonoBehaviour
{
     void OnEnable()
    {
        SceneView.duringSceneGui += OnSceneGUI;
        EditorApplication.hierarchyWindowItemOnGUI += OnHierarchyGUI;
    }

     void OnDisable()
    {
        SceneView.duringSceneGui -= OnSceneGUI;
        EditorApplication.hierarchyWindowItemOnGUI -= OnHierarchyGUI;
    }
     void OnSceneGUI(SceneView obj)
    {
        HandleDragAndDropEvents();
    }

     void OnHierarchyGUI(int instanceID, Rect selectionRect)
    {
        HandleDragAndDropEvents();
    }
     void HandleDragAndDropEvents()
    {
        if (Event.current.type == EventType.DragUpdated)
        {
            OnDragUpdated();
        }
        if (Event.current.type == EventType.DragPerform)
        {
            OnDragPerform();
        }
    }
    void OnDragUpdated()
    {
        Debug.Log("OnDragUpdated()");
    }
    void OnDragPerform()
    {
        Debug.Log("OnDragPerform()");
    }
}

 

 

 

 

 

 

 

 

 

 

 

 

 

'Unity > C#' 카테고리의 다른 글

유니티 오브젝트 경로 관련  (0) 2024.08.23
유니티 라이트 레졸루션 개별설정  (0) 2024.05.12
유니티 프리팹 드래그 드랍  (0) 2024.05.09
posted by 모카쨩
2024. 5. 12. 12:01 Unity/C#

 

 

 

 

 

 

 

 

 

 

 

유니티 2022.3.22.f1 이후의 경우

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 


유니티 2022.3.22.f1 이전의 경우는 아래 스크립트 적용 

 

 

 

SettingLightResolution.unitypackage
0.00MB

 

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

[ExecuteAlways]
public class SettingLightResolution : MonoBehaviour
{
    public Light light;
    public int resolution = 256;
    // Start is called before the first frame update
    void Start()
    {
    }

    // Update is called once per frame
    void Update()
    {
        if (light==null)
        {
            return;
        }
        light.shadowCustomResolution = resolution;
#if UNITY_EDITOR
        UnityEditor.EditorUtility.SetDirty(light);
#endif
    }
}



어쩌다보니 만들게 됨

 

 

 

 

 

 

 

 

'Unity > C#' 카테고리의 다른 글

OnSceneGUI 관련코드  (0) 2024.07.11
유니티 프리팹 드래그 드랍  (0) 2024.05.09
AutomaticShadowDistance  (0) 2024.04.18
posted by 모카쨩
2024. 5. 9. 11:32 Unity/C#

 

 

 

 

원문링크 : 

https://forum.unity.com/threads/solved-how-to-start-draganddrop-action-so-that-sceneview-and-hierarchy-accept-it-like-with-prefabs.822531/

 

[Solved] How to start DragAndDrop action so that SceneView and Hierarchy accept it like with prefabs

Edit: Solution below. I'm building a level design tool which shows a list of prefabs in a custom editor window and lets users drag and drop these...

forum.unity.com

 

 

이 코드는 내가 만든게 아니고 위 링크에서 가져와 간소화 한것일뿐이다

 void OnEnable()
{
    SceneView.duringSceneGui += OnSceneGUI;
    EditorApplication.hierarchyWindowItemOnGUI += OnHierarchyGUI;
}

 void OnDisable()
{
    SceneView.duringSceneGui -= OnSceneGUI;
    EditorApplication.hierarchyWindowItemOnGUI -= OnHierarchyGUI;
}
 void OnSceneGUI(SceneView obj)
{
    HandleDragAndDropEvents();
}

 void OnHierarchyGUI(int instanceID, Rect selectionRect)
{
    HandleDragAndDropEvents();
}
 void HandleDragAndDropEvents()
{
    if (Event.current.type == EventType.DragUpdated)
    {
        OnDragUpdated();
    }
    if (Event.current.type == EventType.DragPerform)
    {
        OnDragPerform();
    }
}
void OnDragUpdated()
{
    Debug.Log("OnDragUpdated()");
}
void OnDragPerform()
{
    Debug.Log("OnDragPerform()");
}

 

 

 

아바타 툴 만들때 사용되었다

 

 

 

 

 

'Unity > C#' 카테고리의 다른 글

유니티 라이트 레졸루션 개별설정  (0) 2024.05.12
AutomaticShadowDistance  (0) 2024.04.18
c# Dictionary(딕셔너리) 관련  (0) 2024.03.19
posted by 모카쨩
2024. 4. 18. 15:40 Unity/C#

 

 

 

https://ahzkwid.booth.pm/items/5632873

 

Automatic Shadow Distance - Wmup - BOOTH

ワールド用です DirectionalLightの影の長さをFPSに応じて自動的に変更するツールです。 動きがきれいじゃないので、キャラクターシャドウ専用に使用するのをお勧めします - Code - https://gist.githu

ahzkwid.booth.pm

여기서 다운 가능

 

 

 

 

 

using UdonSharp;
using UnityEngine;
using UnityEngine.UI;
using VRC.SDKBase;
using VRC.Udon;

[UdonBehaviourSyncMode(BehaviourSyncMode.None)]
public class AutomaticShadowDistance : UdonSharpBehaviour
{
    public Light directionalLight;
    public float frameCheckTimeCycle = 3f;
    int playerLayerIndex = 9;
    public Vector2 targetFps = new Vector2(30, 60);
    public Vector2 defaultShadowDistance = new Vector2(10, 80);
    public Vector2 playerShadowDistance = new Vector2(1,15);

    float tPre = 2;

    void UpdateShadowDistance(float t)
    {
        var defaultShadowDistanceMin = defaultShadowDistance.x;
        var defaultShadowDistanceMax = defaultShadowDistance.y;
        var playerShadowDistanceMin = playerShadowDistance.x;
        var playerShadowDistanceMax = playerShadowDistance.y;


        var targetDistanceDefault = Mathf.Lerp(defaultShadowDistanceMin, defaultShadowDistanceMax, t);
        var targetDistancePlayer = Mathf.Lerp(playerShadowDistanceMin, playerShadowDistanceMax, t);
        
        {
            //QualitySettings.shadowDistance = targetDistanceDefault;
        }
        {
            var ShadowCullDistances = new float[32];
            //ShadowCullDistances[0] = Mathf.Lerp(ShadowCullDistances[0], targetDistanceDefault, 0.1f);
            ShadowCullDistances[0] = targetDistanceDefault;
            ShadowCullDistances[11] = ShadowCullDistances[0];
            ShadowCullDistances[13] = ShadowCullDistances[0];
            ShadowCullDistances[14] = ShadowCullDistances[0];
            ShadowCullDistances[playerLayerIndex] = targetDistancePlayer;
            ShadowCullDistances[10] = ShadowCullDistances[playerLayerIndex];
            ShadowCullDistances[18] = ShadowCullDistances[playerLayerIndex];
            directionalLight.layerShadowCullDistances = ShadowCullDistances;

            //Camera.main.layerCullDistances = ShadowCullDistances;
        }
    }

    LightShadows shadowType = LightShadows.Soft;
    void Start()
    {
        //if (directionalLight==null)
        //{
        //    /*
        //    var lights = FindObjectsOfType<Light>();
        //    foreach (var light in lights)
        //    {
        //        if (light.type==LightType.Directional)
        //        {
        //            directionalLight = light;
        //        }
        //    }
        //    */
        //    /*
        //    var light= FindObjectOfType<Light>();
        //    if (light.type == LightType.Directional)
        //    {
        //        directionalLight = light;
        //    }
        //    */
        //}
        if (directionalLight.shadows != LightShadows.None)
        {
            shadowType = directionalLight.shadows;
        }

        UpdateShadowDistance(0);

        lastCheckTime = 0;
    }
    float lastCheckTime = 0;
    int frameCount = 0;

    public Toggle toggle;
    public Slider slider;
    public GameObject lockPanel;

    public bool alwaysUseShdow = true;
    bool CheckT(float t)
    {
        return ((Mathf.Abs(t - tPre) > 0.1f)
            || ((t == 0) && (tPre < 0.1f))
            || ((t == 1) && (tPre > 0.9f)));
    }
    void Update()
    {
        var useShadowOff = !alwaysUseShdow;

        var toggleManual = toggle;
        lockPanel.SetActive(toggleManual.isOn == false);



        var useShadowOffvalue = 0.1f;
        if (toggleManual.isOn)
        {
            if (slider.value > useShadowOffvalue)
            {
                var t = (slider.value - useShadowOffvalue) * (1f / (1f- useShadowOffvalue));
                if (CheckT(t))
                {
                    UpdateShadowDistance(t);
                    tPre = t;
                }
                if (useShadowOff)
                {
                    if (directionalLight.shadows == LightShadows.None)
                    {
                        directionalLight.shadows = shadowType;
                    }
                }
            }
            else
            {
                if (useShadowOff)
                {
                    if (directionalLight.shadows != LightShadows.None)
                    {
                        directionalLight.shadows = LightShadows.None;
                    }
                }
            }
        }
        else
        {


            frameCount++;

            if (Time.time - lastCheckTime >= frameCheckTimeCycle)
            {
                var fps = 0f;
                if (Time.deltaTime > 0)
                {
                    fps = 1f / Time.deltaTime;
                }
                if (frameCheckTimeCycle > 0.1f)
                {
                    fps = frameCount / frameCheckTimeCycle;
                }


                var min = targetFps.x;
                var max = targetFps.y;
                var t = (Mathf.Clamp(fps, min, max) - min) / (max - min);

                /*
                if ((Mathf.Abs(t - tPre) > 0.1f)
                    || ((t == 0) && (tPre < 0.1f))
                    || ((t == 1) && (tPre > 0.9f)))
                */
                if (CheckT(t))
                {

                    UpdateShadowDistance(t);
                    tPre = t;

                }


                if (Time.time > 10)
                {
                    if (useShadowOff)
                    {
                        if (directionalLight.shadows == LightShadows.None)
                        {
                            if (t > 0.8f)
                            {
                                directionalLight.shadows = shadowType;
                            }
                        }
                        else
                        {
                            if (fps < min / 2)
                            {
                                directionalLight.shadows = LightShadows.None;
                            }
                        }
                    }
                }
                if (directionalLight.shadows == LightShadows.None)
                {
                    slider.value = 0f;
                }
                else
                {
                    slider.value = useShadowOffvalue + t * (1f- useShadowOffvalue);
                }


                frameCount = 0;
                lastCheckTime = Time.time;
            }
        }
    }
}

'Unity > C#' 카테고리의 다른 글

유니티 프리팹 드래그 드랍  (0) 2024.05.09
c# Dictionary(딕셔너리) 관련  (0) 2024.03.19
자주 쓰는 DateTime 코드 모음  (0) 2023.12.19
posted by 모카쨩
2024. 3. 19. 01:48 Unity/C#

 

ClassList to Dictionary

아래의 경우에는 중복되는 userCode의 경우 price를 전부 병합하여 생성한다

왜냐면 Dictionary는 동일키생성을 허용하지 않기 때문이다

 

v1

더보기
var dictionary = classList.GroupBy(x => x.userCode).ToDictionary(x=>x.First().userCode, x=>x.Sum(x=>x.price));

v2

var dictionary = groups.ToDictionary(x => x.Key, x => x.ToList());

 

 

 

Dictionary Sort

//오름차순 정렬
dictionary=dictionary.OrderBy(x => x.Value).ToDictionary(x=>x.Key, x => x.Value); //오름차순 정렬
 
//내림차순 정렬
dictionary=dictionary.OrderByDescending(x => x.Value).ToDictionary(x=>x.Key, x => x.Value); //내림차순 정렬

 

 

슬라이스

{
    //슬라이스(길이만큼 자르기)
    var length = 3;
    dictionary = dictionary.Take(length).ToDictionary(x => x.Key, x => x.Value);
}

 

 

중복제거

단 Dictionary는 원래 중복 Key를 허용하지 않기 때문에 Value만 가능하다

dictionary = dictionary.GroupBy(x => x.Value).Select(x => x.First()).ToDictionary(x => x.Key, x => x.Value); //중복제거

 

 

 

FindIndex

순위를 매길때 사용했다

var rank = dictionary.Keys.ToList().FindIndex(x => x == id);

 

 

Insert

중간에 넣기 전에 동일키를 지우고 넣는다

var item = dictionary.ElementAt(index);
dictionary.Remove(item.Key);
var list = dictionary.ToList();
list.Insert(length - 1, item);
dictionary = list.ToDictionary(x=>x.Key, x => x.Value);

'Unity > C#' 카테고리의 다른 글

AutomaticShadowDistance  (0) 2024.04.18
자주 쓰는 DateTime 코드 모음  (0) 2023.12.19
Path 연산  (0) 2023.09.09
posted by 모카쨩