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

카테고리

분류 전체보기 (2553)
Unity3D (690)
Programming (461)
Server (33)
Unreal (4)
Gamebryo (56)
Tip & Tech (213)
협업 (45)
3DS Max (3)
Game (12)
Utility (133)
Etc (95)
Link (32)
Portfolio (19)
Subject (90)
iOS,OSX (44)
Android (14)
Linux (5)
잉여 프로젝트 (2)
게임이야기 (3)
Memories (20)
Interest (37)
Thinking (37)
한글 (28)
PaperCraft (5)
Animation (408)
Wallpaper (2)
재테크 (18)
Exercise (3)
나만의 맛집 (3)
냥이 (10)
육아 (16)
Total1,630,481
Today102
Yesterday178
05-29 19:54

달력

« » 2022.5
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31        

공지사항

태그목록

반응형

[링크] 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' 카테고리의 다른 글

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

댓글을 달아 주세요

반응형

[링크] 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

 

반응형

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

[링크] Game Package Manager for Unity (by NHN)  (0) 2022.05.11
[링크] Localization(AppName)  (0) 2022.04.05
[Package] Unity Quick Search  (0) 2022.02.18
[링크] UniTask  (0) 2022.01.11
[펌] Unity Timers  (0) 2021.10.20
[펌] Unity Bezier Solution  (0) 2021.10.12
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
[Package] Unity Quick Search  (0) 2022.02.18
[링크] 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
[링크] UniTask  (0) 2022.01.11
[펌] 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
TAG UniTask, Unity

댓글을 달아 주세요

[펌] Unity Timers

Unity3D/Plugins / 2021. 10. 20. 14:23
반응형

 

 

 

We may decide to execute a function not right now, but at a certain time later. That’s called “scheduling a call”. The Timers class helps you to do so with a clean and short syntax without having to worry about enumerators.

Installation · Documentation · License

Made with ♥ by Jeffrey Lanters

 

Installation

Using the Unity Package Manager

Install the latest stable release using the Unity Package Manager by adding the following line to your manifest.json file located within your project's Packages directory, or by adding the Git URL to the Package Manager Window inside of Unity.

"nl.elraccoone.timers": "git+https://github.com/jeffreylanters/unity-timers"

Using OpenUPM

The module is availble on the OpenUPM package registry, you can install the latest stable release using the OpenUPM Package manager's Command Line Tool using the following command.

openupm add nl.elraccoone.timers

Documentation

Syntax

using ElRaccoone.Timers;
Timers.SetTimeout(/* miliseconds */ 1000, /* callback */ () => { /* ... */ });
Timers.SetInterval(/* miliseconds */ 1000, /* callback */ () => { /* ... */ });

Description

We may decide to execute a function not right now, but at a certain time later. That’s called “scheduling a call”. Note that the timers are using unscaled time.

There are two methods for it:

  • setTimeout allows to run a function once after the interval of time.
  • setInterval allows to run a function regularly with the interval between the runs.

Examples

public class MyClass {
  private void Awake () {
    Timers.SetTimeout(1000, () => {
      Debug.Log("A second has passed!");
    });
    Timers.SetTimeout(1000, Notifiy);
    Timers.SetInterval(2500, Notifiy);
  }
  private void Notify () {
    Debug.Log("Notify!!");
  }
}

 

 

[출처] https://openupm.com/packages/nl.elraccoone.timers/#installation

 

📦 Timers - nl.elraccoone.timers

 

openupm.com

 

반응형

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

[Package] Unity Quick Search  (0) 2022.02.18
[링크] UniTask  (0) 2022.01.11
[펌] Unity Timers  (0) 2021.10.20
[펌] Unity Bezier Solution  (0) 2021.10.12
[에셋] I2 Localization(Android/iOS app_name Localization)  (0) 2021.02.25
[링크] 유니티 Easy Save 정리  (2) 2020.04.03
Posted by blueasa
TAG Timers, Unity

댓글을 달아 주세요

반응형

Unity Bezier Solution

Available on Asset Store: https://assetstore.unity.com/packages/tools/level-design/bezier-solution-113074

Forum Thread: https://forum.unity.com/threads/bezier-solution-open-source.440742/

Video: https://www.youtube.com/watch?v=OpniwcFwSY8

Support the Developer ☕

ABOUT

This asset is a means to create bezier splines in editor and/or during runtime: splines can be created and edited visually in the editor, or by code during runtime. It is built upon Catlike Coding's spline tutorial: https://catlikecoding.com/unity/tutorials/curves-and-splines/

INSTALLATION

There are 5 ways to install this plugin:

CREATING & EDITING A NEW SPLINE IN EDITOR

To create a new spline in the editor, click GameObject - Bezier Spline.

Now you can select the end points of the spline in the Scene view and translate/rotate/scale or delete/duplicate them as you wish (each end point has 2 control points, which can also be translated):

The user interface for the spline editor should be pretty self-explanatory with most variables having explanatory tooltips.

When Quick Edit Mode is enabled, new points can quickly be added/inserted to the spline and the existing points can be dragged around/snapped to the scene geometry.

To reverse the order of the end points in a spline, you can right click the BezierSpline component and click the Invert Spline button.

You can tweak the Scene view gizmos via Project Settings/yasirkula/Bezier Solution page (on older versions, this menu is located at Preferences window).

CREATING & EDITING A NEW SPLINE BY CODE

  • Create a new bezier spline

Simply create a new GameObject, attach a BezierSpline component to it (BezierSpline uses BezierSolution namespace) and initialize the spline with a minimum of two end points:

BezierSpline spline = new GameObject().AddComponent<BezierSpline>(); spline.Initialize( 2 );

  • Populate the spline

BezierPoint InsertNewPointAt( int index ): adds a new end point to the spline and returns it

BezierPoint DuplicatePointAt( int index ): duplicates an existing end point and returns it

void RemovePointAt( int index ): removes an end point from the spline

void SwapPointsAt( int index1, int index2 ): swaps indices of two end points

void ChangePointIndex( int previousIndex, int newIndex ): changes an end point's index

  • Shape the spline

You can change the position, rotation, scale and normal values of the end points, as well as the positions of their control points to reshape the spline.

End points have the following properties to store their transformational data: position, localPosition, rotation, localRotation, eulerAngles, localEulerAngles, localScale, normal and autoCalculatedNormalAngleOffset.

Positions of control points can be tweaked using the following properties in BezierPoint: precedingControlPointPosition, precedingControlPointLocalPosition, followingControlPointPosition and followingControlPointLocalPosition. The local positions are relative to their corresponding end points.

End points also have read-only spline and index properties.

// Set first end point's (world) position to 2,3,5 spline[0].position = new Vector3( 2, 3, 5 ); // Set second end point's local position to 7,11,13 spline[1].localPosition = new Vector3( 7, 11, 13 ); // Set handle mode of first end point to Free to independently adjust each control point spline[0].handleMode = BezierPoint.HandleMode.Free; // Reposition the control points of the first end point spline[0].precedingControlPointLocalPosition = new Vector3( 0, 0, 1 ); spline[0].followingControlPointPosition = spline[1].position;

  • Auto construct the spline

If you don't want to position all the control points manually, but rather generate a nice-looking "continuous" spline that goes through the end points you have created, you can call either AutoConstructSpline() or AutoConstructSpline2(). These methods are implementations of some algorithms found on the internet (and credited in the source code). If you want these functions to be called automatically when spline's end points are modified, simply change the spline's autoConstructMode property.

  • Convert spline to a linear path

If you want to create a linear path between the end points of the spline, you can call the ConstructLinearPath() function. Or, if you want this function to be called automatically when spline's end points are modified, simply set the spline's autoConstructMode property to SplineAutoConstructMode.Linear.

  • Auto calculate the normals

If you want to calculate the spline's normal vectors automatically, you can call the AutoCalculateNormals( float normalAngle = 0f, int smoothness = 10 ) function (or, to call this function automatically when spline's end points are modified, simply change the spline's autoCalculateNormals and autoCalculatedNormalsAngle properties). All resulting normal vectors will be rotated around their Z axis by "normalAngle" degrees. Additionally, each end point's normal vector will be rotated by that end point's "autoCalculatedNormalAngleOffset" degrees. "smoothness" determines how many intermediate steps are taken between each consecutive end point to calculate those end points' normal vectors. More intermediate steps is better but also slower to calculate.

If auto calculated normals don't look quite right despite modifying the "normalAngle" (Auto Calculated Normals Angle in the Inspector) and "autoCalculatedNormalAngleOffset" (Normal Angle in the Inspector) variables, you can either consider inserting new end points to the sections of the spline that normals don't behave correctly, or setting the normals manually.

  • Get notified when spline is modified

You can register to the spline's onSplineChanged event to get notified when some of its properties have changed. This event has the following signature: delegate void SplineChangeDelegate( BezierSpline spline, DirtyFlags dirtyFlags ). DirtyFlags is an enum flag, meaning that it can have one or more of these values: SplineShapeChanged, NormalsChanged and/or ExtraDataChanged. SplineShapeChanged flag means that either the spline's Transform values have changed or some of its end points' Transform values have changed (changing control points may also trigger this flag). NormalsChanged flag means that normals of some of the end points have changed and ExtraDataChanged flag means that extraDatas of some of the end points have changed.

BezierSpline also has a version property which is automatically increased whenever the spline's properties change.

NOTE: onSplineChanged event is usually invoked in LateUpdate. Before it is invoked, autoConstructMode and autoCalculateNormals properties' values are checked and the relevant auto construction/calculation functions are executed if necessary.

UTILITY FUNCTIONS

The framework comes with some utility functions. These functions are not necessarily perfect but most of the time, they get the job done. Though, if you want, you can use this framework to just create splines and then apply your own logic to them.

  • Vector3 GetPoint( float normalizedT )

A spline is essentially a mathematical formula with a [0,1] clamped input (usually called t), which generates a point on the spline. As the name suggests, this function returns a point on the spline. As t goes from 0 to 1, the point moves from the first end point to the last end point (or goes back to first end point, if spline is looping).

  • Vector3 GetTangent( float normalizedT )

Tangent is calculated using the first derivative of the spline formula and gives the direction of the movement at a given point on the spline. Can be used to determine which direction an object on the spline should look at at a given point.

  • Vector3 GetNormal( float normalizedT )

Interpolates between the end points' normal vectors. Note that this plugin doesn't store any intermediate data between end point pairs, so if two consecutive end points have almost the opposite tangents, then their interpolated normal vector may not be correct at some parts of the spline. Inserting a new end point between these two end points could resolve this issue. By default, all normal vectors have value (0,1,0).

  • BezierPoint.ExtraData GetExtraData( float normalizedT )

Interpolates between the extra data provided at each end point. This data has 4 float components and can implicitly be converted to Vector2, Vector3, Vector4, Quaternion, Rect, Vector2Int, Vector3Int and RectInt.

  • BezierPoint.ExtraData GetExtraData( float normalizedT, ExtraDataLerpFunction lerpFunction )

Uses a custom function to interpolate between the end points' extra data. For example, BezierWalker components use this function to interpolate the extra data with Quaternion.Lerp.

  • float GetLengthApproximately( float startNormalizedT, float endNormalizedT, float accuracy = 50f )

Calculates the approximate length of a segment of the spline. To calculate the length, the spline is divided into "accuracy" points and the Euclidean distances between these points are summed up.

Food For Thought: BezierSpline has a length property which is a shorthand for GetLengthApproximately( 0f, 1f ). Its value is cached and won't be recalculated unless the spline is modified.

  • Segment GetSegmentAt( float normalizedT )

Returns the two end points that are closest to normalizedT. The Segment struct also holds a localT value in range [0,1], which can be used to interpolate between the properties of these two end points. You can also call the GetPoint(), GetTangent(), GetNormal() and GetExtraData() functions of this struct and the returned values will be calculated as if the spline consisted of only these two end points.

  • Vector3 FindNearestPointTo( Vector3 worldPos, out float normalizedT, float accuracy = 100f, int secondPassIterations = 7, float secondPassExtents = 0.025f )

Finds the nearest point on the spline to any given point in 3D space. The normalizedT parameter is optional and it returns the parameter t corresponding to the resulting point. To find the nearest point, the spline is divided into "accuracy" points and the nearest point is selected. Then, a binary search is performed in "secondPassIterations" steps in range [normalizedT-secondPassExtents, normalizedT+secondPassExtents] to fine-tune the result.

  • Vector3 FindNearestPointToLine( Vector3 lineStart, Vector3 lineEnd, out Vector3 pointOnLine, out float normalizedT, float accuracy = 100f, int secondPassIterations = 7, float secondPassExtents = 0.025f )

Finds the nearest point on the spline to the given line in 3D space. The pointOnLine and normalizedT parameters are optional.

  • Vector3 MoveAlongSpline( ref float normalizedT, float deltaMovement, int accuracy = 3 )

Moves a point (normalizedT) on the spline deltaMovement units ahead and returns the resulting point. The normalizedT parameter is passed by reference to keep track of the new t parameter.

  • EvenlySpacedPointsHolder CalculateEvenlySpacedPoints( float resolution = 10f, float accuracy = 3f )

Finds uniformly distributed points along the spline and returns a lookup table. The lookup table isn't refreshed automatically, so it may be invalidated when the spline is modified. This function's resolution parameter determines approximately how many points will be calculated per each segment of the spline and accuracy determines how accurate the uniform spacing will be. The default values should work well in most cases.

Food For Thought: BezierSpline has an evenlySpacedPoints property which is a shorthand for CalculateEvenlySpacedPoints(). Its value is cached and won't be recalculated unless the spline is modified.

EvenlySpacedPointsHolder class has spline, splineLength and uniformNormalizedTs variables. In addition, it has the following convenience functions:

GetNormalizedTAtPercentage: converts a percentage to normalizedT value, i.e. if you enter 0.5f as parameter, it will return the normalizedT value of the spline that corresponds to its actual middle point.

GetNormalizedTAtDistance: finds the normalizedT value that is specified units away from the spline's starting point.

GetPercentageAtNormalizedT: inverse of GetNormalizedTAtPercentage.

  • PointCache GeneratePointCache( EvenlySpacedPointsHolder lookupTable, ExtraDataLerpFunction extraDataLerpFunction, PointCacheFlags cachedData = PointCacheFlags.All, int resolution = 100 )

Returns a cache of data for uniformly distributed points along the spline. The cache isn't refreshed automatically, so it may be invalidated when the spline is modified. This function's resolution parameter determines how many uniformly distributed points the cache will have. To determine which data should be cached, cachedData parameter is used. PointCacheFlags is an enum flag, meaning that it can have one or more of these values: Positions, Normals, Tangents, Bitangents and/or ExtraDatas. lookupTable is an optional parameter and, by default, spline's evenlySpacedPoints is used. extraDataLerpFunction is also an optional parameter and is used only when PointCacheFlags.ExtraDatas is included in cachedData.

Food For Thought: BezierSpline has a pointCache property which is a shorthand for GeneratePointCache(). Its value is cached and won't be recalculated unless the spline is modified.

PointCache class has positions, normals, tangents, bitangents, extraDatas and loop variables (loop determines whether or not the spline had its loop property set to true while calculating the cache). In addition, it has the following functions: GetPoint, GetNormal, GetTangent, GetBitangent and GetExtraData (if the required data for a function wasn't included in PointCacheFlags, then the function will throw an exception). If a spline is rarely modified at runtime, then point cache can be used to get points, tangents, normals, etc. along the spline in a cheaper and uniform way.

OTHER COMPONENTS

The plugin comes with some additional components that may help you move objects or particles along splines. These components are located in the Utilities folder.

  • BezierWalkerWithSpeed

Moves an object along a spline with constant speed. There are 3 travel modes: Once, Ping Pong and Loop. If Look At is Forward, the object will always face forwards (end points' normal vectors will be used as up vectors). If it is SplineExtraData, the extra data stored in the spline's end points is used to determine the rotation. You can modify this extra data from the points' Inspector. The smoothness of the rotation can be adjusted via Rotation Lerp Modifier. Normalized T determines the starting point. Each time the object completes a lap, its On Path Completed () event is invoked. To see this component in action without entering Play mode, click the Simulate In Editor button.

  • BezierWalkerWithTime

Travels a spline in Travel Time seconds. Movement Lerp Modifier parameter defines the smoothness applied to the position of the object. If High Quality is enabled, the spline will be traversed with constant speed but the calculations can be more expensive.

  • BezierWalkerLocomotion

Allows you to move a number of objects together with this object on a spline. This component must be attached to an object with a BezierWalker component (tail objects don't need a BezierWalker, though). Look At, Movement Lerp Modifier and Rotation Lerp Modifier parameters affect the tail objects. If tail objects jitter too much, enabling High Quality may help greatly but the calculations can be more expensive.

  • ParticlesFollowBezier

Moves particles of a Particle System in the direction of a spline. It is recommended to set the Simulation Space of the Particle System to Local for increased performance. This component affects particles in one of two ways:

Strict: particles will strictly follow the spline. They will always be aligned to the spline and will reach the end of the spline at the end of their lifetime. This mode performs slightly better than Relaxed mode

Relaxed: properties of the particle system like speed, Noise and Shape will affect the movement of the particles. Particles in this mode will usually look more interesting. If you want the particles to stick with the spline, though, set their speed to 0

Note that if the Resimulate tick of the Particle System is selected, particles may move in a chaotic way for a short time while changing the properties of the particle system from the Inspector.

  • BezierAttachment

Snaps an object to the specified point of the spline. You can snap the object's position and/or rotation values, optionally with some offsets. Rotation can be snapped in one of two ways:

Use Spline Normals: spline's normal vectors will be used to determine the object's rotation

Use End Point Rotations: the Transform rotation values of the spline's end points will be used to determine the object's rotation

  • BezierLineRenderer

Automatically positions a Line Renderer's points so that its shape matches the target spline's shape. It is possible to match the shape of only a portion of the spline by tweaking the Spline Sample Range property. If Line Renderer's Use World Space property is enabled, then its points will be placed at the spline's current position. Otherwise, the points will be placed relative to the Line Renderer's position and they will rotate/scale with the Line Renderer.

  • BendMeshAlongBezier

Modifies a MeshFilter's mesh to bend it in the direction of a spline. If High Quality is enabled, evenly spaced bezier points will be used so that the mesh bends uniformly but the calculations will be more expensive. If Auto Refresh is enabled, the mesh will be refreshed automatically when the spline is modified (at runtime, this has the same effect with disabling the component but in edit mode, disabling the component will restore the original mesh instead). Mesh's normal and tangent vectors can optionally be recalculated in one of two ways:

Modify Originals: the original mesh's normal and tangent vectors will be rotated with the spline

Recalculate From Scratch: Unity's RecalculateNormals and/or RecalculateTangents functions will be invoked to recalculate these vectors from scratch

Note that this component doesn't add new vertices to the original mesh, so if the original mesh doesn't have enough vertices in its bend axis, then the bent mesh will have jagged edges on complex splines.

 

 

[출처] https://openupm.com/packages/com.yasirkula.beziersolution/

 

📦 Bezier Solution - com.yasirkula.beziersolution

 

openupm.com

 

반응형

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

[링크] UniTask  (0) 2022.01.11
[펌] Unity Timers  (0) 2021.10.20
[펌] Unity Bezier Solution  (0) 2021.10.12
[에셋] I2 Localization(Android/iOS app_name Localization)  (0) 2021.02.25
[링크] 유니티 Easy Save 정리  (2) 2020.04.03
[링크] 유니티 Local Notification을 활용해보자  (0) 2019.07.01
Posted by blueasa
TAG Bezier, Unity

댓글을 달아 주세요

반응형

[첨언]

예전에 사놓은건데 Android/iOS app_name Localization(현지화)을 지원한다길래 써보니..편하다!!

 

 

[에셋스토어 링크] assetstore.unity.com/packages/tools/localization/i2-localization-14884

 

I2 Localization | 다국어 지원 | Unity Asset Store

Get the I2 Localization package from Inter Illusion and speed up your game development process. Find this & other 다국어 지원 options on the Unity Asset Store.

assetstore.unity.com

 

반응형
Posted by blueasa

댓글을 달아 주세요

반응형

[링크] https://mentum.tistory.com/156

 

유니티 Easy Save 정리

# 20190329 추가 : 개발자는 EasySave 2는 호환성 때문에 남겨놓은 것이기 때문에 EasySave 3를 사용해줄 것을 당부했음. #. EasySave 간단 정리 - Class, Structure 등 어떤 것이든 저장할 수 있습니다! - Save /..

mentum.tistory.com

 

반응형
Posted by blueasa

댓글을 달아 주세요

  1. 2020.04.15 16:25 익명  댓글주소  수정/삭제  댓글쓰기

    비밀댓글입니다

반응형

[링크]

http://blog.naver.com/simtt/220851899973

 

[Unity] 유니티 Local Notification을 활용해보자

iOS의 경우 Unity 자체에서 로컬 알람 기능을 제공해준다. 안드로이드는 직접 구현할 수도 있지만, 그냥...

blog.naver.com

 

반응형
Posted by blueasa

댓글을 달아 주세요

반응형

 

[링크]

https://lib.dasony.net/7

 

[NATIVE, ANDROID] Local Notification(로컬 알림) 유니티 플러그인

개요 유니티에서 네이티브 알림 기능을 iOS 만 제공하고 있습니다. 안드로이드에서 로컬 알림을 이용하려면 플러그인을 직접 제작하거나 다른 사람이 만들어 둔 플러그인을 사용해야 합니다. 이번에 다소니닷넷에..

lib.dasony.net

 

반응형
Posted by blueasa

댓글을 달아 주세요