Get it on Google Play


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

블로그 이미지
불펌때문에 드래그 방지 건것가지고
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

보호되어 있는 글입니다.
내용을 보시려면 비밀번호를 입력하세요.

2024. 9. 8. 07:28 Unity

 

 

Opening file failed

Opening file 경로.meta: 지정된 경로를 찾을 수 없습니다.

 

 

 

에셋 수정툴 만들때 잘못된 GUID 입력으로 발생한다

 

 

 

문제가 되는 에셋과 Library 폴더 삭제로 해결가능하다

 

 

 

 

 

그런데 라이브러리 통째로 지우는건 시간이 오래 걸려서 위 폴더만 지워도 된다

 

 

'Unity' 카테고리의 다른 글

LTCGI  (0) 2024.09.06
유니티 Assembly Definition Asset  (0) 2024.04.16
게임개발용 부하테스트 2024  (0) 2024.02.27
posted by 모카쨩
2024. 9. 6. 10:08 Unity

 

 

 

https://ltcgi.dev/#Attribution

 

✨ About LTCGI | LTCGI Documentation

LTCGI is an optimized plug-and-play realtime area light solution using the linearly transformed cosine algorithm for standalone Unity and VRChat. Free to use with attribution. It can utilize the Unity build-in lightmapper or Bakery for realistic shadows on

ltcgi.dev

 

 

화면자체가 라이팅이 되는 시스템

 

영화관같은거 만들때 쓰지 않을까 

 

 

'Unity' 카테고리의 다른 글

Opening file failed 에러  (0) 2024.09.08
유니티 Assembly Definition Asset  (0) 2024.04.16
게임개발용 부하테스트 2024  (0) 2024.02.27
posted by 모카쨩
2024. 8. 23. 06:30

보호되어 있는 글입니다.
내용을 보시려면 비밀번호를 입력하세요.

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 모카쨩