블로그 이미지
Every unexpected event is a path to learning for you.

카테고리

분류 전체보기 (2731)
Unity3D (814)
Script (91)
Extensions (14)
Effect (3)
NGUI (77)
UGUI (8)
Physics (2)
Shader (36)
Math (1)
Design Pattern (2)
Xml (1)
Tips (200)
Link (22)
World (1)
AssetBundle (25)
Mecanim (2)
Plugins (68)
Trouble Shooting (68)
Encrypt (7)
LightMap (4)
Shadow (4)
Editor (8)
Crash Report (3)
Utility (9)
UnityVS (2)
Facebook SDK (2)
iTween (3)
Font (10)
Ad (14)
Photon (2)
IAP (1)
Google (8)
Android (45)
iOS (41)
Programming (474)
Server (33)
Unreal (4)
Gamebryo (56)
Tip & Tech (228)
협업 (57)
3DS Max (3)
Game (12)
Utility (136)
Etc (96)
Link (32)
Portfolio (19)
Subject (90)
iOS,OSX (51)
Android (14)
Linux (5)
잉여 프로젝트 (2)
게임이야기 (3)
Memories (20)
Interest (38)
Thinking (38)
한글 (30)
PaperCraft (5)
Animation (408)
Wallpaper (2)
재테크 (18)
Exercise (3)
나만의 맛집 (3)
냥이 (10)
육아 (16)
Total
Today
Yesterday
03-29 07:22
I used the post in the 'EDIT 2' to come up with a decent solution. I don't know if it will work 100% of the time and I would love for someone to correct me if I have chosen a poor solution. This should allow me to run code before the build starts, and if the build fails or succeeds without changing the unity build pipeline.
class CustomBuildPipeline : MonoBehaviour, IPreprocessBuildWithReport, IPostprocessBuildWithReport
{
    public int callbackOrder => 0;

    // CALLED BEFORE THE BUILD
    public void OnPreprocessBuild(BuildReport report)
    {
        // Start listening for errors when build starts
        Application.logMessageReceived += OnBuildError;
    }

    // CALLED DURING BUILD TO CHECK FOR ERRORS
    private void OnBuildError(string condition, string stacktrace, LogType type)
    {
        if (type == LogType.Error)
        {
            // FAILED TO BUILD, STOP LISTENING FOR ERRORS
            Application.logMessageReceived -= OnBuildError;
        }
    }

    // CALLED AFTER THE BUILD
    public void OnPostprocessBuild(BuildReport report)
    {
        // IF BUILD FINISHED AND SUCCEEDED, STOP LOOKING FOR ERRORS
        Application.logMessageReceived -= OnBuildError;
    }
}

 

[출처] https://stackoverflow.com/questions/58840114/unity-editor-detect-when-build-fails

반응형
Posted by blueasa
, |

Unity 2021.3.16f1

Burst 1.6.6

----

 

유니티에서 필요한 에셋을 추가(Magica Cloth)하니 Package Manager에서 Burst도 추가를 요구한다.

추가하고 빌드하니 아래와 같은 폴더를 자동생성하고 있다.

 

[폴더명 예시] BuildName_BurstDebugInformation_DoNotShipDeleter

 

그래서 이전에 했던방식과 같이 OnPostprocessBuild에서 빌드 후 삭제하기로 함

 

using System.IO;
using UnityEditor;
using UnityEditor.Build;
using UnityEditor.Build.Reporting;

/// <summary>
/// Burst 관련 빌드 후 생성되는 백업 폴더 삭제
/// </summary>
public sealed class BurstDebugInformation_DoNotShipDeleter : IPostprocessBuildWithReport
{
    public int callbackOrder => 0;
    // 확정된 폴더명은 readonly 변수로 만듬
    private readonly string m_strBurstDebugInformation_DoNotShip = "BurstDebugInformation_DoNotShip";

    public void OnPostprocessBuild(BuildReport report)
    {
        var summary = report.summary;
        var platform = summary.platform;

        if (platform != BuildTarget.StandaloneWindows 
            && platform != BuildTarget.StandaloneWindows64
            && platform != BuildTarget.Android  // Android 플랫폼에서도 작동하도록 추가
            && platform != BuildTarget.iOS)     // iOS 플랫폼에서도 작동하도록 추가
        {
            return;
        }

        if (summary.options.HasFlag(BuildOptions.Development))
        {
            return;
        }

        var outputPath = summary.outputPath;
        var outputDirectoryPath = Path.GetDirectoryName(outputPath);

        // 빌드 폴더 이름이 FileName을 따라가서 FileName을 폴더명으로 쓰도록 수정
        var outputFileName = Path.GetFileNameWithoutExtension(outputPath);
        //var productName = PlayerSettings.productName;

        var backUpThisFolderPath = $"{outputDirectoryPath}/{outputFileName}_{m_strBurstDebugInformation_DoNotShip}";

        if (!Directory.Exists(backUpThisFolderPath))
        {
            return;
        }

        Directory.Delete(backUpThisFolderPath, true);
    }
}

 

[참조] https://forum.unity.com/threads/burstdebuginformation_donotship-in-builds.1172273/

 

BurstDebugInformation_DoNotShip in builds

After a fairly recent update to Burst, I'm not seeing a folder named this in my builds: Gravia_BurstDebugInformation_DoNotShip A couple of questions:...

forum.unity.com

 

반응형
Posted by blueasa
, |

[사용엔진] Unity 2021.3.9f1

 

Unity 2021을 설치하고 Android 빌드를 하니 빌드 파일 위치에 'BuildFileName_BackUpThisFolder_ButDontShipItWithYourGame'라는 폴더가 생긴다.

 

난 프로젝트 메인 위치에 빌드 파일 생성하게 하다보니 'BuildFileName_BackUpThisFolder_ButDontShipItWithYourGame' 폴더가 git이 인식하는 위치에 생성되는데다

BuildFileName을 계속 넘버링하면서 만들다보니 위의 폴더도 계속 생성된다.

 

  [문제점]

1. 폴더가 파일명에 맞게 계속 생성돼서 계속 많아진다.(SSD/HDD 용량이슈 등)

2. 생성되는 폴더 위치가 git 관리 영역이라 git에 생성된 파일로 보여서 문제가 생긴다.(파일 갯수도 많음)

 

그래서 유니티에 생성 안하게 하는 옵션이 없나하고 검색해 봤지만 별시리 없는 것 같고..

계속 검색하다보니 PostprocessBuild로 해당 폴더를 삭제 해버리는 방식을 사용하는 포스팅을 보고 적용해서 잘되는 것을 확인하고 올려 둔다.

 

[해결방법]

- 아래 Script를 Editor 폴더에 넣자~

 

using System.IO;
using UnityEditor;
using UnityEditor.Build;
using UnityEditor.Build.Reporting;

public sealed class WindowsIL2CPPBuildBackUpThisFolderDeleter : IPostprocessBuildWithReport
{
    public int callbackOrder => 0;
    // 확정된 폴더명은 readonly 변수로 만듬
    private readonly string m_strBackUpThisFolder_ButDontShipItWithYourGame = "BackUpThisFolder_ButDontShipItWithYourGame";

    public void OnPostprocessBuild(BuildReport report)
    {
        var summary = report.summary;
        var platform = summary.platform;

        if (platform != BuildTarget.StandaloneWindows 
            && platform != BuildTarget.StandaloneWindows64
            && platform != BuildTarget.Android  // Android 플랫폼에서도 작동하도록 추가
            && platform != BuildTarget.iOS)     // iOS 플랫폼에서도 작동하도록 추가
        {
            return;
        }

        if (summary.options.HasFlag(BuildOptions.Development))
        {
            return;
        }

        var outputPath = summary.outputPath;
        var outputDirectoryPath = Path.GetDirectoryName(outputPath);
        
        // 빌드 폴더 이름이 FileName을 따라가서 FileName을 폴더명으로 쓰도록 수정
        var outputFileName = Path.GetFileNameWithoutExtension(outputPath);
        //var productName = PlayerSettings.productName;

        var backUpThisFolderPath = $"{outputDirectoryPath}/{outputFileName}_{m_strBackUpThisFolder_ButDontShipItWithYourGame}";

        if (!Directory.Exists(backUpThisFolderPath))
        {
            return;
        }

        Directory.Delete(backUpThisFolderPath, true);
    }
}

 

아래 참조한 포스팅의 스크립트는 Windows에서 Android 플랫폼 빌드를 했을때 처리가 안되고,

BuildFileName을 제대로 찾지 못해서 스크립트 내용 중 일부를 수정해서 제대로 삭제하는 것까지 확인함.

 

[추가 처리]

혹시 몰라서 git에 잘못 올라가지 않도록, git ignore list에 아래와 같이 추가 해놓음.

[git ignore list 추가] *_BackUpThisFolder_ButDontShipItWithYourGame/

 

 

[참조] https://baba-s.hatenablog.com/entry/2022/02/08/090000

 

【Unity】Windows IL2CPP ビルドした時に生成される XXXX_BackUpThisFolder_ButDontShipItWithYourGame を自動で削

ソースコード using System.IO; using UnityEditor; using UnityEditor.Build; using UnityEditor.Build.Reporting; public sealed class WindowsIL2CPPBuildBackUpThisFolderDeleter : IPostprocessBuildWithReport { public int callbackOrder => 0; public void OnPo

baba-s.hatenablog.com

 

반응형
Posted by blueasa
, |

[요약]

Scene View 껐다 다시 키자.

 

 

[링크] https://ssscool.tistory.com/498

 

유니티 씬뷰에서 UI, 오브젝트 모두 선택이 안될 때 ( Unity Can't select object in scene view )

유니티 씬뷰에서 UI, 오브젝트 등 모두 선택이 되지 않을 때 ( Unity Can't select object in scene view ) 유니티 에디터 버전을 2019.4 LTS 에서 2020.3 LTS로 버전업을 했다. 2019.4 버전대의 고질병인 JDK, SD..

ssscool.tistory.com

 

반응형
Posted by blueasa
, |

개인적인 학습 목적으로 번역된 강좌글입니다. 

 

제 블로그로 링크가 되어 있는것은, 이쪽으로 번역글을 옮기는 과정이 번거롭고

비효율적이기 때문에 그렇고, 결코 블로그 홍보를 목적으로 하지 않습니다.

 

다른 곳에 퍼가신다면 일본어 원문 링크를 꼭 표기하여 주시기 바랍니다.

 

유니티 에디터에서 기본 제공되는 에디터 UI에서 더 나아가 직접 커스터마이즈하고

툴을 만들기 위해 필요한 정보들을 담고 있습니다.

 

원문

http://anchan828.github.io/editor-manual/web/index.htmlViewer

 

1장 에디터 확장에서 사용하는 폴더Viewer

2장 표준에서 사용할 수 있는 에디터 확장기능Viewer

3장 데이터 저장Viewer

4장 ScriptableObjectViewer

5장 SerializedObject에 대해서Viewer

6장 EditorGUIViewer

7장 EditorWindowViewer

8장 MenuItemViewer

9장 CustomEditorViewer

10장 PropertyDrawerViewer

11장 ProjectWindowUtilViewer

12장 Undo에 대해서Viewer

13장 다양한 이벤트의 콜백Viewer

14장 ReorderbleListViewer

15장 ScriptTemplatesViewer

16장 Gizmo(기즈모)Viewer

17장 Handle(핸들)Viewer

18장 HierarchySortViewer

19장 GUI를 직접 만들기Viewer

20장 OverwriterViewer

21장 파티클을 제어하기Viewer

22장 SpriteAnimationPreview(스프라이트 목록의 표시)Viewer

23장 SpriteAnimationPreviwe(스프라이트 애니메이션)Viewer

24장 씬 Asset에 스크립트를 AttachViewer

25장 시간을 제어하는 TimeControlViewer

26장 AssetDatabaseViewer

27장 HideFlagsViewer

28장 AssetPostprocessorViewer(완)



[출처] http://lab.gamecodi.com/board/zboard.php?id=GAMECODILAB_Lecture&page=1&sn1=&divpage=1&sn=off&ss=on&sc=on&select_arrange=hit&desc=asc&no=477

반응형
Posted by blueasa
, |


[Free Asset] https://assetstore.unity.com/packages/tools/utilities/keystore-helper-58627


using UnityEngine;
using UnityEditor;
using System.IO;
 
[InitializeOnLoad]
public class PreloadSigningAlias
{
 
    static PreloadSigningAlias ()
    {
        PlayerSettings.Android.keystorePass = "KEYSTORE_PASS";
        PlayerSettings.Android.keyaliasName = "ALIAS_NAME";
        PlayerSettings.Android.keyaliasPass = "ALIAS_PASSWORD";
    }
 
}



[출처] https://forum.unity.com/threads/android-keystore-passwords-not-saved-between-sessions.235213/

반응형
Posted by blueasa
, |
Here is an advanced version, Just for fun. :p
Features
  • Multiple Define Symbols
  • Safety
  • Runs when Compile ends
  • Removes Duplicates
Installation
  1. Download the Script or Copy/Paste it from the Below
  2. Open Script
  3. Go to Symbols property and add your own symbols
  4. Go back to Unity and wait for compile ends
  5. All done, now check Player Settings, The symbols added
Code (CSharp):
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using UnityEngine;
  5. using UnityEditor;
  6.  
  7. /// <summary>
  8. /// Adds the given define symbols to PlayerSettings define symbols.
  9. /// Just add your own define symbols to the Symbols property at the below.
  10. /// </summary>
  11. [InitializeOnLoad]
  12. public class AddDefineSymbols : Editor
  13. {
  14.  
  15.     /// <summary>
  16.     /// Symbols that will be added to the editor
  17.     /// </summary>
  18.     public static readonly string [] Symbols = new string[] {
  19.         "MYCOMPANY",
  20.         "MYCOMPANY_MYPACKAGE"
  21.     };
  22.  
  23.     /// <summary>
  24.     /// Add define symbols as soon as Unity gets done compiling.
  25.     /// </summary>
  26.     static AddDefineSymbols ()
  27.     {
  28.         string definesString = PlayerSettings.GetScriptingDefineSymbolsForGroup ( EditorUserBuildSettings.selectedBuildTargetGroup );
  29.         List<string> allDefines = definesString.Split ( ';' ).ToList ();
  30.         allDefines.AddRange ( Symbols.Except ( allDefines ) );
  31.         PlayerSettings.SetScriptingDefineSymbolsForGroup (
  32.             string.Join ( ";", allDefines.ToArray () ) );
  33.     }
  34.  
  35. }
Thanks.




[출처] https://forum.unity.com/threads/scripting-define-symbols-access-in-code.174390/

반응형
Posted by blueasa
, |


Unity3D 에디터 커스터마이즈 (1)



반응형
Posted by blueasa
, |