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

카테고리

분류 전체보기 (2831)
Unity3D (880)
Script (92)
Extensions (16)
Effect (3)
NGUI (81)
UGUI (9)
Physics (2)
Shader (37)
Math (1)
Design Pattern (2)
Xml (1)
Tips (203)
Link (26)
World (1)
AssetBundle (25)
Mecanim (2)
Plugins (85)
Trouble Shooting (71)
Encrypt (7)
LightMap (4)
Shadow (4)
Editor (12)
Crash Report (3)
Utility (9)
UnityVS (2)
Facebook SDK (2)
iTween (3)
Font (18)
Ad (14)
Photon (2)
IAP (1)
Google (11)
URP (4)
Android (51)
iOS (46)
Programming (479)
Server (33)
Unreal (4)
Gamebryo (56)
Tip & Tech (187)
협업 (64)
3DS Max (3)
Game (12)
Utility (140)
Etc (98)
Link (32)
Portfolio (19)
Subject (90)
iOS,OSX (52)
Android (16)
Linux (5)
잉여 프로젝트 (2)
게임이야기 (3)
Memories (20)
Interest (38)
Thinking (38)
한글 (30)
PaperCraft (5)
Animation (408)
Wallpaper (2)
재테크 (19)
Exercise (3)
나만의 맛집 (3)
냥이 (10)
육아 (16)
Total
Today
Yesterday

[링크] https://github.com/agens-no/iMessageStickerUnity

 

GitHub - agens-no/iMessageStickerUnity: An iMessage Sticker plugin for Unity3d that adds a Sticker extension target to an xCode

An iMessage Sticker plugin for Unity3d that adds a Sticker extension target to an xCode project created by Unity3d - GitHub - agens-no/iMessageStickerUnity: An iMessage Sticker plugin for Unity3d t...

github.com

 

 

반응형
Posted by blueasa
, |



반응형
Posted by blueasa
, |

[링크] https://wergia.tistory.com/353

 

[Unity] 유니티 공식 지원 오브젝트 풀링

개발단에 가입하여 베르의 게임 개발 유튜브를 후원해주세요! 베르의 게임 개발 유튜브 안녕하세요! 여러분들과 함께 게임 개발을 공부하는 베르입니다! 게임 개발에 도움이 되는 강좌들을 올

wergia.tistory.com

 

반응형
Posted by blueasa
, |

[링크] https://blog.naver.com/canny708/221557851696

 

버스트 컴파일러 (Burst Compiler)

ECS는 메모리 설계를 최적화하기 위한 기능이고, C# Job System은 멀티 스레딩을 더욱 극한으로 사용...

blog.naver.com

 

반응형
Posted by blueasa
, |

Ever stuck on how to render a video on a TV screen in a game? Lets us learn the concept of playing a video in Unity.

You can import many different formats of video file into Unity. Unity stores such imported video files as VideoClip assets. A Video Clip is an imported video file, which the Video Player component uses to play video content. The playing video also accompanies audio content, if it has any. Typical file extensions for video files include .mp4, .mov, .webm, and .wmv.

To check the video file compatibility in unity, click here.

The Video Player component

Video Player component is used to attach video files to GameObjects, and play them on the GameObject’s Texture at run time.

By default, the Material Property of a Video Player component is set to MainTex, which means that when the Video Player component is attached to a GameObject that has a Renderer, it automatically assigns itself to the Texture on that Renderer (because this is the main Texture for the GameObject).

You can also set the following specific target for the video to play on, using the Render Mode property of Video Player:

  • A Camera plane
  • A Render Texture
  • A Material Texture parameter
  • Any Texture field in a component

Playing a video already in Assets

If you already have a video clip in your asset folder, you can simply set the Source property of Video Player component to Video Clip and drag and drop your video clip in the inspector. Alternatively, you can set the video clip in script using clip property.

    public VideoPlayer myVideoPlayer;
    public VideoClip myClip;
    myVideoPlayer.clip = myClip;

You can tick the property Play On Awake if you want to play the video the moment the Scene launches. Otherwise you can trigger the video playback with Play() command at another point during run time.

    myVideoPlayer.Play();

Playing Video from url in Unity

You might be having a video on server which you want to load on runtime. Here is how we can do it:

    private IEnumerator playVideoInThisURL(string _url)
    {
        myVideoPlayer.source = UnityEngine.Video.VideoSource.Url;
        myVideoPlayer.url = _url;
        myVideoPlayer.Prepare();

        while (myVideoPlayer.isPrepared == false){
           yield return null; 
        }
        myVideoPlayer.Play();
    }

Here, we have waited till the video player successfully prepared the content to be played.

Note, the url can also contain the path of the file.

Downloading and Saving Video from Url

The above line of code plays the video directly from the url. Alternatively, you can download the video file and then play the video from this path. The line of code below downloads the video clip and saves it at Application.persistentDataPath.

    private IEnumerator loadVideoFromThisURL(string _url)
    {
        UnityWebRequest _videoRequest = UnityWebRequest.Get(_url);
        yield return _videoRequest.SendWebRequest();

        if (_videoRequest.isDone == false || _videoRequest.error != null)
        {
            yield return null;
        }
        else
        {
            Debug.Log("Video Done - " + _videoRequest.isDone);
            byte[] _videoBytes = _videoRequest.downloadHandler.data;
            string _pathToFile = Path.Combine(Application.persistentDataPath, "video.mp4");
            File.WriteAllBytes(_pathToFile, _videoBytes);
            StartCoroutine(this.playVideoInThisURL(_pathToFile));
            yield return null;
        }
    }

Now we have learnt the art of playing video in Unity. Drop in your comments for any queries or feedback.

Happy Coding!

 

[출처] https://codesaying.com/playing-video-in-unity/

 

Playing Video in Unity - Code Saying

Ever stuck on how to render a video on a TV screen in a game? Or a full screen video? Lets us learn the art playing a video in Unity.

codesaying.com

 

반응형
Posted by blueasa
, |

[링크] https://yoonstone-games.tistory.com/87

 

[Unity] Canvas/UI 에 영상 넣는 방법 (Raw Image, Render Texture)

지난 게시글에서 plane, cube, sphere 에 영상 넣는 방법을 알아봤다면 이번에는 UI인 Canvas Image에 영상 넣는 방법을 함께 알아보도록 하겠습니다 :) ↓ 지난 게시글 ↓ https://yoonstone-games.tistory.com/39?cate

yoonstone-games.tistory.com

 

반응형
Posted by blueasa
, |

[링크] https://github.com/nhn/gpm.unity

 

GitHub - nhn/gpm.unity: A brand of NHN providing free services required for game development.

A brand of NHN providing free services required for game development. - GitHub - nhn/gpm.unity: A brand of NHN providing free services required for game development.

github.com

 

Game Package Manager for Unity

🌏 English

🚩 목차

개요

Game Package Manager는 NHN에서 게임 제작에 필요한 서비스들을 무료로 제공하는 브랜드입니다.
게임 제작에 필요한 서비스는 계속 추가 예정입니다.
서비스 개선 사항이나 궁금한 사항은 아래로 언제든지 연락 주시기 바랍니다.

Email : dl_gpm_help@nhn.com
GitHub Issue : https://github.com/nhn/gpm.unity/issues

서비스

서비스설명

Manager
Asset Store에서 다운로드
Manager에서 서비스 목록을 확인할 수 있고, 원하는 서비스를 설치, 제거, 업데이트할 수 있습니다.
WebView 게임에서 다양하게 사용할 수 있는 웹뷰를 제공합니다.
AssetManagement 유니티 에셋들을 손쉽게 관리할 수 있는 툴입니다.
UI Unity UI를 보다 효율적으로 사용할 수 있는 컴포넌트 제공.
LogViewer Unity Log와 디바이스 시스템 정보를 화면에서 확인할 수 있고, 개발자가 미리 등록한 API를 호출해 볼 수 있는 툴입니다.
Communicator Communicator는 하나의 공통화된 인터페이스를 제공해 Native와 Data를 쉽게 주고 받을 수 있는 프레임웍입니다.
Profiler 디바이스 성능과 시스템 정보를 화면에서 확인할 수 있어 최적화에 도움을 주는 툴입니다.
Adapter Adapter는 하나의 공통화된 인터페이스를 제공해 여러 IdP의 기능을 쉽게 적용할 수 있습니다.
DLST DLST는 중복되는 라이브러리들을 검색해서 지울 수 있는 툴입니다.

📜 License

This software is licensed under the MPL © NHN.

반응형

'Unity3D > Plugins' 카테고리의 다른 글

[펌] Playing Video in Unity  (0) 2022.11.25
[링크] [Unity] Canvas/UI에 영상 넣는 방법(Raw Image, Render Texture)  (0) 2022.11.25
[링크] Localization(AppName)  (0) 2022.04.05
[Package] Unity Quick Search  (0) 2022.02.18
[링크] UniTask  (0) 2022.01.11
Posted by blueasa
, |

[링크] https://docs.unity3d.com/Packages/com.unity.localization@1.2/manual/index.html

 

About Localization | Localization | 1.2.1

About Localization Use the Localization package to configure localization settings for your application. Add support for multiple languages and regional variants, including: String localization: Set different strings to display based on locale. Use the Sma

docs.unity3d.com

 

반응형
Posted by blueasa
, |

Unity Quick Search

Search anything in Unity.

Search Providers

Using the shortcut Alt + ' or the Help -> Quick Search menu will bring out the Quick Search Tool. This extensible tool allows you to search over multiple area of Unity.

It is easy to add new search providers to the Quick Search Tool (see API section below), by default we ship with these SearchProviders:

Assets

All assets in the current project are available for search. From an asset you can apply the following actions:

  • Select the asset (in the Project browser)
  • Open the asset (using an external editor if necessary)
  • Show in Explorer (Finder)

Asset provider supports advance type filtering (Similar to Project Hierarchy):

Current Scene

All GameObjects in the current scene are available for search. Activating a scene item in the Quick Search tool will select the corresponding GameObject in the Scene.

Each menu items in Unity is available for search. You can execute the menu item from the Quick Search Tool. This is especially useful to pop that elusive Test Runner or the Profiler!

Settings

Each Project Settings or Preferences pages is available for search. The Quick Search Tool will open the Unified Settings Window at the required pages.

Online Search Providers

We have a SearchProvider that allows to search various Unity websites. Using this provider will open your default browser at a specific Unity page and perform a search and display some results. You can search the following websites and it is very easy to add new web search providers:

Keyboard Navigation

All the features of the Quick Search tool can be access using the keyboard:

  • The Search box is always focused and you can type even with an element selected.
  • Alt + Left Arrow : Toggle the Filter view
    • Using Up Arrow, Down Arrow in the Filter view cycle between filters.
    • Using spacebar toggle a filter

  • Alt + Right Arrow brings the action menu

  • Alt + Up Arrow or Alt + Down Arrow navigate through the search history:

Filters

There are 2 levels of filtering available in the Quick Search Tool:

Provider filters

Those filters define which providers are available for a search. This can help reduce the amount of items return by a search query especially if you know what type of item you are looking for.

Note that there are more specialized shortcuts to call the Quick Search Tool with a specific provider filter enabled:

  • Alt + Shit + A : Assets only search
  • Alt + Shit + M : Menu only search
  • Alt + Shit + S : Scene only search

Provider text filters

From the Quick Search Box you can type a search provider search filter token that will restrain the search to specific providers. The search tokens are:

  • Asset: p:
  • Menu: me:
  • Scene: h:
  • Online Search: web:

Example of queries using text providers:

  • p:Player : Search assets containing "Player"
  • h:Main Camera : Search scene for GameObjects with "Main Camera" in their name
  • me:Test Runner : Search menus item for Test Runner
  • se:VFX : Search settings (project and preferences) for VFX

Provider specific filters

Some provider (i.e the Asset provider) supports specific filters:

As usual you can pass the same search tokens used by the project browser to a search query:

When opening the Quick Search Tool using Alt + ` the state (and filters) of your previous search is preserved:

Drag and Drop

Asset items and Scene Items supports drag and drop from the QuickSearch window to anywhere that supports it (hierarchy view, game view, inspector, etc):

API

Creating new SearchProvider is fairly easy. It basically comes down to providing a function to fetch and search for items and to provide action handlers to activate any selected item.

SearchProvider

An SearchProvider manages search for specific type of items and manages thumbnails, description and subfilters. Its basic API is as follow:

public class SearchProvider
{
    public SearchProvider(string id, string displayName = null);

    // Create an Item bound to this provider.
    public SearchItem CreateItem(string id, string label = null, string description = null, Texture2D thumbnail = null);

    // Utility functions use to check if a search text matches a string.
    public static bool MatchSearchGroups(string searchContext, string content);
    public static bool MatchSearchGroups(string searchContext, string content, out int startIndex, out int endIndex);

    public NameId name;

    // Text filter key use to enable this Provider from the NameId search box
    public string filterId;
    // Functor used to fetch item description
    public DescriptionHandler fetchDescription;
    // Functor used to fetch thumbnail icon
    public PreviewHandler fetchThumbnail;
    // Functor used to execute a search query
    public GetItemsHandler fetchItems;
    // Functor use to check if an item is still valid
    public IsItemValidHandler isItemValid;
    // Sub filter specific to this provider
    public List<NameId> subCategories;
    // Called when QuickSearchWindow is opened allowing a provider to initialize search data.
    public Action onEnable;
    // Called when QuickSearchWindow is closed.
    public Action onDisable;
}

Note that since the UI of the NameId is done using a virtual scrolling algorithm some SearchItem fields (thumbail and description) are fetched on demand. This means the SearchProvider needs to be initialized with specific Handlers (fetchDescription, fetchThumbnail) if you want to populate those fields.

Registering an SearchProvider

Adding a new SearchProvider is just creating a function tagged with the [SearchItemProvider] attribute. This function must returns a new SearchProvider instance:

[SearchItemProvider]
internal static SearchProvider CreateProvider()
{
    return new SearchProvider(type, displayName)
    {
        filterId = "me:",
        fetchItems = (context, items, provider) =>
        {
            var itemNames = new List<string>();
            var shortcuts = new List<string>();
            GetMenuInfo(itemNames, shortcuts);

            items.AddRange(itemNames.Where(menuName =>
                    SearchProvider.MatchSearchGroups(context.searchText, menuName))
                .Select(menuName => provider.CreateItem(menuName, Path.GetFileName(menuName), menuName)));
        },

        fetchThumbnail = (item, context) => Icons.shortcut
    };
}

By default an SearchProvider must have a type (ex: asset, menu, scene...) that is unique among providers and a display Name (used in the Provider filter dialog).

Specifying a filterId is optional but it makes text based filtering easier (ex: p: my_asset).

The bulk of the provider work happens in the fetchItems functor. This is the function a provider creator must fulfill to do an actual search (and filtering). The fetchItems signature is:

// context: all the necessary search context (tokenized search, sub filters...)
// items: list of items to populate
// provider: the provider itself
public delegate void GetItemsHandler(SearchContext context, List<SearchItem> items, SearchProvider provider);

The SearchProvider must add new SearchItems to the items list.

An SearchItem is a simple struct:

public struct SearchItem
{
    // Unique id of this item among this provider items.
    public string id;
    // Display name of the item
    public string label;
    // If no description is provided, SearchProvider.fetchDescription will be called when the item is first displayed.
    public string description;
    // If no thumbnail are provider, SearchProvider.fetchThumbnail will be called when the item is first displayed.
    public Texture2D thumbnail;
}

Only the id is necessary to be filled.

When doing filtering according to SearchContext.searchText we recommend using the static function SearchProvider.MatchSearchGroup which makes partial search (and eventually fuzzy search) easy (see example above).

Asynchronous Search Results

If your search providers can take a long time to compute its results or rely on asynchronous search engine (ex: WebRequests) you can use the context.sendAsyncItems callback to populate search results asynchronously.

The SearchContext also contains a searchId that needs to be provided with the call to sendAsyncItems. This allows QuickSearch to know for which search those results are provided.

An example of using asynchronous search result would be:

new SearchProvider(type, displayName)
{
    filterId = "store:",
    fetchItems = (context, items, provider) =>
    {
        var currentSearchRequest = UnityWebRequest.Get(url + context.searchQuery);
        currentSearchRequest.SetRequestHeader("X-Unity-Session", InternalEditorUtility.GetAuthToken());
        var currentSearchRequestOp = currentSearchRequest.SendWebRequest();
        currentSearchRequestOp.completed += op => {

            var items = // GetItems from websearch

            // Notify the search about async items:
            // ensure to set the searchId you are providing result for!
            context.sendAsyncItems(context.searchId, items);
        };
    }
};

The QuickSearch package contains 2 examples with async results:

  • com.unity.quicksearch/Editor/Providers/Examples/AssetStoreProvider.cs : which provide a way to query the asset store using WebRequest.
  • com.unity.quicksearch/Editor/Providers/Examples/ESS.cs: which creates a thread to start the EntrianSource search indexer to provide full text search for assets in your project.

Registering an Action Handler

Actions can be register for a specific provider. These actions buttons will be drawn next to the SearchItem of the specified provider type:

Since registering an action handler is a different process than regisering a provider this means you can register new action handlers for existing providers (mind blown)!

Here is an example of how to register actions for the Asset provider:

[SearchActionsProvider]
internal static IEnumerable<SearchAction> ActionHandlers()
{
    return new[]
    {
        new SearchAction("asset", "select", Icons.@goto, "Select asset...")
        {
            handler = (item, context) =>
            {
                var asset = AssetDatabase.LoadAssetAtPath<Object>(item.id);
                if (asset != null)
                {
                    Selection.activeObject = asset;
                    EditorGUIUtility.PingObject(asset);
                    EditorWindow.FocusWindowIfItsOpen(Utils.GetProjectBrowserWindowType());
                }
            }
        },
        new SearchAction("asset", "open", SearchIcon.open, "Open asset... (Alt+Enter)")
        {
            handler = (item, context) =>
            {
                var asset = AssetDatabase.LoadAssetAtPath<Object>(item.id);
                if (asset != null) AssetDatabase.OpenAsset(asset);
            }
        },
        new SearchAction("asset", "reveal", SearchIcon.folder, "Show in Explorer")
        {
            handler = (item, context) =>
            {
                EditorUtility.RevealInFinder(item.id);
            }
        }
    };
}

Basically you create a function tagged with the [SearchActionsProvider] attribute. This function must returns an IEnumerable<SearchAction>.

An SearchAction describe and action and provide a handler to execute the action on a specific SearchItem

public class SearchAction
{
    public SearchAction(string providerType, string name, Texture2D icon = null, string tooltip = null);
    public ActionHandler handler;
    public EnabledHandler isEnabled;
}

providerType is the provider unique id for which you are registering the action.

ActionHandler is of the following signature:

// item: item that needs the action to be executed.
// context: search context of the SearchTool when the item is executed.
public delegate void ActionHandler(SearchItem item, SearchContext context);

An action can be setup with a isEnabled predicate that will decide if the action is available (i.e. enabled) for a specific item.

SearchService

The SearchService manages most of the persisted state of the Quick Search Tool and provider a global end point to access the filter.

The common usage of the SearchService forSearchProvider writer is to register a shortcut that will open the Quick Search Tool with a specific set of filter enabled:

[Shortcut("Window/Quick Search Tool/Assets", KeyCode.A, ShortcutModifiers.Alt | ShortcutModifiers.Shift)]
public static void PopQuickSearch()
{
    // Disable all filter
    SearchService.Filter.ResetFilter(false);

    // Enabled only the asset SearchProvider
    SearchService.Filter.SetFilter(true, "asset");

    // Disabled the packages sub filter
    SearchService.Filter.SetFilter(false, "asset", "a:packages");

    // Open the Quick Search Tool to allow a quick search of assets!
    SearchTool.ShowWindow();
}

 

[출처] https://docs.unity3d.com/Packages/com.unity.quicksearch@1.0/manual/index.html

 

Unity Quick Search | Package Manager UI website

Unity Quick Search Search anything in Unity. Search Providers Using the shortcut Alt + ' or the Help -> Quick Search menu will bring out the Quick Search Tool. This extensible tool allows you to search over multiple area of Unity. It is easy to add new sea

docs.unity3d.com

 

반응형

'Unity3D > Plugins' 카테고리의 다른 글

[링크] Game Package Manager for Unity (by NHN)  (0) 2022.05.11
[링크] Localization(AppName)  (0) 2022.04.05
[링크] UniTask  (0) 2022.01.11
[펌] Unity Timers  (0) 2021.10.20
[펌] Unity Bezier Solution  (0) 2021.10.12
Posted by blueasa
, |

[링크] UniTask

Unity3D/Plugins / 2022. 1. 11. 16:21

[링크] https://openupm.com/packages/com.cysharp.unitask/

 

📦 UniTask - com.cysharp.unitask

 

openupm.com

 

반응형

'Unity3D > Plugins' 카테고리의 다른 글

[링크] Localization(AppName)  (0) 2022.04.05
[Package] Unity Quick Search  (0) 2022.02.18
[펌] Unity Timers  (0) 2021.10.20
[펌] Unity Bezier Solution  (0) 2021.10.12
[에셋] I2 Localization(Android/iOS app_name Localization)  (0) 2021.02.25
Posted by blueasa
, |