DEV/Unity

    [solved]is missing the class attribute 'ExtensionOfNativeClass'

    interface를 생성 후, 하이어라키- 객체 에는 붙일 수 없다. 빼면 해결

    Unity 코루틴(coroutine) 관련하여 ..

    일반 함수를 실행하면, 값을 반환하기 전에 실행이 완료된다. 그래서 (일정)시간이 지난 후에 실행되어야 하는 이벤트 호출에 사용할 수 없다. ex. 페이드와 같은 애니메이션 처리를 일반 함수에 처리할 수 없다. 그래서 코루틴 함수를 사용하여 중간에 시간(프레임)정지 처리도 할 수 있는 방법이 있다. 근데, 해당 이벤트 처리 후에 값을 받아오고 싶어졌다. return bool 을 원해서 찾아본 결과 1. 코루틴이 끝나면 함수가 실행되도록 public void callbackTest(){ //for Lambda StartCoroutine(callbackTestCor((x) => { Debug.Log("ServerCallBackTest: " + x); } )); } IEnumerator callbackTest..

    [Unity] IAP 에러 / 예시 따라하기

    [Unity] IAP 에러 / 예시 따라하기

    IAP 결제 직후 gameObject를 false 해버리면 나는 문제였다. IAP 오류error 1)unity iap InvalidOperationException: Collection was modified; enumeration operation may not execute.2) Purchase not correctly processed for product "상품명". Add an active IAPButton to process this purchase, or add an IAPListener to receive any unhandled purchase events. UnityEngine.GUI:CallWindowDelegate (UnityEngine.GUI/WindowFunction,int,in..

    vscode 단축키 /// summary shortcut!!

    vscode 단축키 /// summary shortcut!!

    https://marketplace.visualstudio.com/items?itemName=k--kato.docomment C# XML Documentation Comments - Visual Studio Marketplace Extension for Visual Studio Code - Generate C# XML documentation comments for /// marketplace.visualstudio.com Type "///", it auto-generates an XML documentation comment like this: 드디어 찾았다... VSCODE에서는 지원 안해줘서 익스텐션 깔아야함. https://www.biew.co.kr/entry/Visual-Studio-CodeVS..

    [Unity] 클릭이 필요없는 Canvas 처리 -  Canvas Group (canvas uninteractable/interactable false)

    [Unity] 클릭이 필요없는 Canvas 처리 - Canvas Group (canvas uninteractable/interactable false)

    사용할 Canvas에 Canvas Group component를 추가해서 제어할 수 있다. 자꾸 클릭할때 범위가 겹쳐서 버튼들이 클릭이 잘 안되고, 보이기만 해야되는 ui를 canvas group에서 interactable - false Blocks Raycasts - false 로 설정해주었다. ( 나는 raycast 기능도 필요없어서 해제했다.) https://docs.unity3d.com/kr/530/ScriptReference/CanvasGroup.html

    [solved] Unity Build Error : Access to the path "Library/BuildPlayerData\Editor" is denied.

    [solved] Unity Build Error : Access to the path "Library/BuildPlayerData\Editor" is denied.

    UnauthorizedAccessException: Access to the path "Library/BuildPlayerData\Editor" is denied. System.IO.Directory.Delete (System.String path) (at :0) System.IO.Directory.RecursiveDelete (System.String path) (at :0) System.IO.Directory.Delete (System.String path, System.Boolean recursive) (at :0) UnityEditor.VisualStudioIntegration.DirectoryIOProvider.Delete (System.String path, System.Boolean recu..

    [solved] Unity Error -  Animation Events don't always fire.

    [solved] Unity Error - Animation Events don't always fire.

    Unity Error Animation이 끝난 후에 트리거로 설정한 애니메이션이 실행이 안된다. 좀 찾아보니 간헐적으로 실행한다고 되어있다 ㅡ.ㅡ (Unity Animation end function is not fired.) https://answers.unity.com/questions/806949/animation-events-not-firing.html Animation events not firing - Unity Answers answers.unity.com MY TODO : Animation Event에서 AttackEnd를 정상적으로 호출해야된다. 내부 구조 : AttackEnd() { isAttacking = false; } isAttacking 변수가 계속 false처리가 안되고, tr..

    Unity Build Error  after try under API 28

    Unity Build Error after try under API 28

    WARNING: The option 'android.enableR8' is deprecated and should not be used anymore. It will be removed in a future version of the Android Gradle plugin, and will no longer allow you to disable R8. Unity Gradle Error: Colliding Attributes The attribute provider#androidx.work.impl.WorkManagerInitializer@authorities=com.McorGames.DarkPrincess.workmanager-init in :androidx.work.work-runtime-2.1.0: ..

    [solved] Unity JDK Build error

    [solved] Unity JDK Build error

    No Java runtime present, requesting install. CommandInvokationFailure: Failed to update Android SDK package list. /Applications/Unity/Hub/Editor/2019.4.20f1/PlaybackEngines/AndroidPlayer/SDK/tools/bin/sdkmanager --list Unity Hub 에 JDK 설치가 되어있는데도 나타나는 에러 ... 찾아보니 2019년 에디터에서 오류나는데 jdk 8버전에서는 에러가 안난다고 한다. homebrew로 jdk 설치 .. brew tap adoptopenjdk/openjdk brew install --cask adoptopenjdk8 java -ver..

    [solved] Unity Version Downgrade error solved 유니티 다운그레이드 성공

    [solved] Unity Version Downgrade error solved 유니티 다운그레이드 성공

    Successful. 'RevisionsService' does not contain a definition for 'FetchSingleRevisionCallback' and no accessible extension method github.com/Unity-Technologies/arfoundation-samples/issues/591 [Bug] Importing the project in Unity 2019.4 gives errors · Issue #591 · Unity-Technologies/arfoundation-samples Unity bug report case number Please log a bug at https://unity3d.com/unity/qa/bug-reporting an..

    Unity load csv type error (한글 인식 오류)

    foxtrotin.tistory.com/121 unity csv파일 유니티로 불러오기(StreamReader 사용)-유니티 csv파일 형식으로 스테이지 만들기 슬슬 퀴즈 게임의 윤곽이 잡혔는데 스테이지를 만들고 있는 중에 문제가 생겼다 지금 스테이지가 시작하는 구조는 1. 스테이지 선택 씬에서 스테이지를 선택하면 그 스테이지 번호를 메인 씬으 foxtrotin.tistory.com .csv 를 메모장으로열어서 UTF-8로 덮어서 저장하면 잘 됩니다.

    [solved] unity build error (BuildPlayerWindow+DefaultBuildMethods.BuildPlayer)

    +2021.11.04 Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 -> 유니티 재부팅 ---------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------- at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer 1) reimport asset 2) 프로세서 삭제 해도 안돼서.. 남은에러 하나가 Starting a..

    [solved] unity class Object reference not set to an instance of an object (class initialize 클래스 초기화 에러)

    (스크립트 안에서 class 선언시 NullReferenceException) 클래스를 생성을 했다. class Item { } 그리고 다른 클래스에서 해당 클래스를 사용하려고 하니, NullReferenceException 에러가 떴다. class ItemGroup{ Item item; void start(){ item = new item(); ... ... } } new () 처리를 해주고 그 다음 순서부터 해당 클래스를 사용하면 된다... 쉬운듯 하면서도 뭐지 하고 public 생각도들게 만든다..; 도움이 되셨으면 좋아요 눌러주세요 ~

    unity  - 9 slice 디자인 같은 이미지 크기와 상관없이 쓰기

    unity - 9 slice 디자인 같은 이미지 크기와 상관없이 쓰기

    크기가 다른데 디자인이 계속 일정한 버튼 이미지들 이미지 용량이 너무 아까워서 최적화를 찾아보며 9슬라이스를 알게 되었다. STEP 1. Sprite - MeshType: Full Rect, 뭉개지는 부분 안쪽으로 9분할 2. Image component ImageType : sliced 크기가 다른데 image 컴포넌트 크기만큼 Sprite가 조정되어서 적용된 모습.

    Unity Play Video File

    Unity Play Video File

    #unity videio player area over camera #유니티 동영상 영역 재생 #unity 2d 동영상 재생 #play video on Unity UI - 흠 MeshRenderere.cortingOrder =15000로도 하나본데 ... Component : VideoPlayer Step: (1) Clip 연결 Wait For First Frame는 첫 프레임을 기다리는 과정인데 유니티 영상이 비교적 화질이 높거나 또는 안드로이드로 재생시 영상 프레임이 저하가 됩니다. 이를 어느정도 감소시키는 기능입니다 : Play On Awake이 켜져있을때 번째 프레임이 텍스처에 로드 될 때까지 기다릴 지 여부를 결정한다. 끌 경우 초기 몇 프레임이 짤려나가는 불상사가 있을 수 있다. Playbac..

    [sloved] Unity click button through image (click over the other images)

    [sloved] Unity click button through image (click over the other images)

    버튼 위에 이미지를 생성하는데, 해당 이미지가 클릭이 되어서 관통하지 못하고.. 버튼이 안눌러지는 문제가 있었다.. 사람들이 여러 방법을 통해서 했는데... 정말 말도안되게 간단했다 .. . 그냥 이미지 속성에서 RayCast Target을 enable false 하면 된다 ,. 황당할 정도 .. . (참고) answers.unity.com/questions/897955/how-to-click-on-button-that-is-behind-transparent.html

    [solved] unity UI Text Color change separately 부분 색 바꾸기

    [solved] unity UI Text Color change separately 부분 색 바꾸기

    1 2 3 4 5 6 7 8 using UnityEnginen.UI; public Text showText; ... string t = "" + "320%" + ""; showText.text = t; Colored by Color Scripter cs 를 직접적으로 넣어주면 색이 바뀌는 모습을 알 수 있다. 그러면 텍스트 부분 색 변경 예시 : 기존에 설정한 텍스트 컬러 + 코드에서 설정한 녹색 컬러가 입혀진 모습 1 2 string t = "공격력 300%" + "> " + "" + "320%" + ""; showText.text = t; Colored by Color Scripter cs \

    Unity Atlas 정리 및 이미지 최적화 정리

    Unity Atlas 정리 및 이미지 최적화 정리

    스프라이트 아틀라스 프로퍼티 생성 방법 Sprite Atlas 를 생성하려면 메뉴에서 Asset > Create > Sprite Atlas 로 이동하십시오. 그러면 Unity가 에셋 폴더에 *.spriteatlas 파일 확장자가 붙은 스프라이트 아틀라스를 생성합니다. * 나도 여기다 정리하고 내가 볼라고 쓰는글 ... Tight Packing : 지정한 Max Texture Size (1024)안에서 남는 여백에 rotate하면서 꽉꽉 채워서 이미지가 합쳐진다. (using alpha area tightly) @@ Unity Atlas overlay 이미지 겹치는 문제 : 갑자기 이미지가 여러개 섞여서 나왔다. => Max Texture Size 가 넘친거다.. => 1024 -> 2048 로 간단히 해..

    [solved] Unity Scroll View position initialize

    Unity Scroll View Content position reset 유니티에서 스크롤로 쭉 내린 후에, 다른 페이지 갔다가 다시 진입하면 그 위치 그대로 스크롤이 내려져 있다. -> 맨 위 리스트를 보기 위해서 위치를 초기화 하려고 한다. 한참 찾았는데 단순한 rect 위치 문제였다. 간단히 해결! 다들 헤매는 이유는 position 으로 접근한듯 anchoredPosition 임! 1 2 3 4 5 6 7 8 public RectTransform ScrollContent; public void setRectPosition() { float x = ScrollContents.anchoredPosition.x; ScrollContents.anchoredPosition = new Vector3(x, 0..

    Unity ads error Banner fail

    Unity ads error Banner fail

    Execution failed for task ':launcher:checkReleaseDuplicateClasses'. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr) Copying assembly from 'Temp/Assembly-CSharp.dll' to 'Library/ScriptAssemblies/Assembly-CSharp.dll' failed 머지 어떻게 해결했뜨랑