Загрузка...

Unity Dialogue System - Removing whitespaces, special characters and making errors case insensitive

In this video we're going to be removing whitespaces and special characters from the nodes, groups and toolbar text fields and also make so our node and group errors are case insensitive.

This means that we can't write names such as "Dialogue Name" or "Dialogue&Name", as they will be transformed into files, but also means "dialogueName" and "DialogueName" will now be considered the same in our error system.

________________________________________________________

Timestamps:

00:00 Introduction
00:50 Text Utility File
01:13 Where will we remove whitespaces from?
01:25 Removing whitespaces from the node name
02:22 Removing whitespaces from the group title
02:45 Removing whitespaces from the toolbar file name
03:53 Shouldn't be able to insert any whitespaces
04:12 Next Problem: Repeated names are case insensitive
04:37 Adding the "ToLower" Method
05:04 Repeated names should now be case sensitive
05:19 Next Problem: Names accept special characters
05:45 Removing special characters from the names
06:27 Shouldn't be able to insert most special characters

________________________________________________________

Useful links:

● Final Code (GitHub): https://github.com/Wafflus/unity-dialogue-system
● TextUtility (Pastebin): https://pastebin.com/qSVNV0k7
● GraphView (Unity Documentation): https://docs.unity3d.com/ScriptReference/Experimental.GraphView.GraphView.html
● "RemoveWhiteSpaces" Method (Stackoverflow): https://stackoverflow.com/a/37368176
● "RemoveSpecialCharacters" Alternatives (Stackoverflow): https://stackoverflow.com/questions/3210393/how-do-i-remove-all-non-alphanumeric-characters-from-a-string-except-dash
● ChangeEvent (Unity Documentation): https://docs.unity3d.com/ScriptReference/UIElements.ChangeEvent_1.html
● ChangeEvent "target" (Unity Documentation): https://docs.unity3d.com/ScriptReference/UIElements.EventBase-target.html
● TextField (Unity Documentation): https://docs.unity3d.com/ScriptReference/UIElements.TextField.html
● ToLower (C# Documentation): https://docs.microsoft.com/en-us/dotnet/api/system.string.tolower?view=net-5.0
● IsLetterOrDigit (C# Documentation): https://docs.microsoft.com/en-us/dotnet/api/system.char.isletterordigit?view=net-5.0
● Dialogue System (Playlist): https://www.youtube.com/watch?v=nvELzBYMK1U&list=PL0yxB6cCkoWK38XT4stSztcLueJ_kTx5f
● Requirements (Playlist Video): https://www.youtube.com/watch?v=yBM112uokM8&list=PL0yxB6cCkoWK38XT4stSztcLueJ_kTx5f&index=2

________________________________________________________

● Subscribe: https://www.youtube.com/channel/UCeeZW9pXSyDqLLu7t5xX7ug?sub_confirmation=1

● Follow me on Twitter: https://twitter.com/IndieWafflus

________________________________________________________

Видео Unity Dialogue System - Removing whitespaces, special characters and making errors case insensitive канала Indie Wafflus
Яндекс.Метрика
Все заметки Новая заметка Страницу в заметки
Страницу в закладки Мои закладки
На информационно-развлекательном портале SALDA.WS применяются cookie-файлы. Нажимая кнопку Принять, вы подтверждаете свое согласие на их использование.
О CookiesНапомнить позжеПринять