{"id":297955,"date":"2020-01-30T15:00:22","date_gmt":"2020-01-30T15:00:22","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=297955"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=297955","title":{"rendered":"\u0412\u044b\u0432\u043e\u0434 \u0432\u043d\u0443\u0442\u0440\u0438\u0438\u0433\u0440\u043e\u0432\u044b\u0445 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Particle System"},"content":{"rendered":"\n<div class=\"post__text post__text-html\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/486260\/\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/74b\/904\/6a5\/74b9046a520d2199cfc062791bdc1cc5.jpg\" alt=\"image\"><\/p>\n<h4>\u0417\u0430\u0434\u0430\u0447\u0430<\/h4>\n<p>  \u041f\u0440\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043d\u0430\u0448\u0435\u0439 \u0438\u0433\u0440\u044b The Unliving, \u043c\u044b \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u043b\u0438 \u043f\u0435\u0440\u0435\u0434 \u0441\u043e\u0431\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0443 \u043f\u043e \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044e \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439, \u0442\u0430\u043a\u0438\u0445, \u043a\u0430\u043a \u043d\u0430\u043d\u0435\u0441\u0435\u043d\u043d\u044b\u0439 \u0443\u0440\u043e\u043d, \u043d\u0435\u0445\u0432\u0430\u0442\u043a\u0430 \u0437\u0434\u043e\u0440\u043e\u0432\u044c\u044f \u0438\u043b\u0438 \u044d\u043d\u0435\u0440\u0433\u0438\u0438, \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u0430 \u043d\u0430\u0433\u0440\u0430\u0434\u044b, \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0445 \u043e\u0447\u043a\u043e\u0432 \u0437\u0434\u043e\u0440\u043e\u0432\u044c\u044f \u0438 \u0442.\u0434., \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Particle System. \u042d\u0442\u043e \u0431\u044b\u043b\u043e \u0440\u0435\u0448\u0435\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 \u0434\u043b\u044f \u043a\u0430\u0441\u0442\u043e\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u044d\u0444\u0444\u0435\u043a\u0442\u043e\u0432 \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u0438 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0433\u043e \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0442\u0430\u043a\u0438\u0445 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439, \u0447\u0442\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u0442\u0438\u0447\u043d\u043e \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 UI-\u0441\u0438\u0441\u0442\u0435\u043c\u044b Unity.<\/p>\n<p>  \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0434\u0430\u043d\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043f\u043e\u0434\u0440\u0430\u0437\u0443\u043c\u0435\u0432\u0430\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0432\u0441\u0435\u0433\u043e \u043b\u0438\u0448\u044c \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u043d\u0441\u0442\u0430\u043d\u0441\u0430 Particle System \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0442\u0438\u043f\u0430 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439, \u0447\u0442\u043e \u0434\u0430\u0435\u0442 \u043e\u0433\u0440\u043e\u043c\u043d\u044b\u0439 \u043f\u0440\u0438\u0440\u043e\u0441\u0442 \u0432 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043f\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e \u0441 \u0432\u044b\u0432\u043e\u0434\u043e\u043c \u044d\u0442\u0438\u0445 \u0436\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Unity UI.<br \/>  <a name=\"habracut\"><\/a><br \/>  <b>\u0421\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043e \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u0435 \u0443\u0440\u043e\u043d\u0430<\/b><\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/597\/961\/b10\/597961b10d0ca2e3e8fcd56c2cefb824.gif\" alt=\"image\"><\/div>\n<p>  <b>\u0422\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043e \u043d\u0435\u0445\u0432\u0430\u0442\u043a\u0435 \u0437\u0434\u043e\u0440\u043e\u0432\u044c\u044f<\/b><\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/79a\/b45\/e90\/79ab45e904a5c648f9c62fb66a7c5049.gif\" alt=\"image\"><\/div>\n<p>  <\/p>\n<h4>\u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u044f<\/h4>\n<p>  \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0448\u0435\u0439\u0434\u0435\u0440\u0430 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u043c \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043b\u0435\u043d\u043d\u0443\u044e \u0442\u0435\u043a\u0441\u0442\u0443\u0440\u0443, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0435 UV-\u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b. \u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0441 UV-\u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0430\u043c\u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u0434\u0432\u0443\u043c\u044f \u043f\u043e\u0442\u043e\u043a\u0430\u043c\u0438 (vertex streams) \u0432 ParticleSystem \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e ParticleSystem.SetCustomParticleData \u0432 \u0432\u0438\u0434\u0435 \u0441\u043f\u0438\u0441\u043a\u0430 Vector4.<\/p>\n<p>  \u041d\u0430\u0448\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0442\u0435\u043a\u0441\u0442\u0443\u0440\u044b \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0435\u0439 10 \u0441\u0442\u0440\u043e\u043a \u0438 10 \u0441\u0442\u043e\u043b\u0431\u0446\u043e\u0432 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0448\u0440\u0438\u0444\u0442\u0430 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d \u043b\u044e\u0431\u043e\u0439 \u043c\u043e\u043d\u043e\u0448\u0438\u0440\u0438\u043d\u043d\u044b\u0439 \u0448\u0440\u0438\u0444\u0442. \u042d\u0442\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432\u043e \u0438\u0437\u0431\u0435\u0436\u0430\u043d\u0438\u0435 \u0440\u0430\u0437\u043d\u044b\u0445 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u043e\u0432 \u043c\u0435\u0436\u0434\u0443 \u0441\u0438\u043c\u0432\u043e\u043b\u0430\u043c\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f.<\/p>\n<p>  \u2192 <a href=\"https:\/\/github.com\/timur-pub\/textparticles\/blob\/master\/pub\/monospaced_font.psd\">\u0418\u0441\u0445\u043e\u0434\u043d\u0438\u043a \u0442\u0435\u043a\u0441\u0442\u0443\u0440\u044b \u0432 PSD<\/a><\/p>\n<h4>\u041f\u043e\u0448\u0430\u0433\u043e\u0432\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f<\/h4>\n<p>  <b>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 Vector4 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0432 Vertex Stream<\/b><\/p>\n<p>  \u0414\u043b\u044f \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043d\u0430\u0431\u043e\u0440\u0430 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 SymbolsTextureData.<\/p>\n<p>  \u041c\u0430\u0441\u0441\u0438\u0432 chars \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0432\u0440\u0443\u0447\u043d\u0443\u044e, \u043f\u043e \u043f\u043e\u0440\u044f\u0434\u043a\u0443 \u0434\u043e\u0431\u0430\u0432\u0438\u0432 \u0432 \u043d\u0435\u0433\u043e \u0432\u0441\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u044b \u0442\u0435\u043a\u0441\u0442\u0443\u0440\u044b \u0448\u0440\u0438\u0444\u0442\u0430 \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 \u043b\u0435\u0432\u043e\u0433\u043e-\u0432\u0435\u0440\u0445\u043d\u0435\u0433\u043e \u0443\u0433\u043b\u0430.<\/p>\n<pre><code class=\"cs\">[Serializable] public struct SymbolsTextureData {     \/\/\u0421\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u0430\u0442\u043b\u0430\u0441 \u0448\u0440\u0438\u0444\u0442\u0430     public Texture texture;     \/\/\u041c\u0430\u0441\u0441\u0438\u0432 \u043d\u0430\u0431\u043e\u0440\u0430 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u043f\u043e \u043f\u043e\u0440\u044f\u0434\u043a\u0443, \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 \u043b\u0435\u0432\u043e\u0433\u043e-\u0432\u0435\u0440\u0445\u043d\u0435\u0433\u043e \u0443\u0433\u043b\u0430     public char[] chars;          \/\/Dictionary \u0441 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0430\u043c\u0438 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0441\u0438\u043c\u0432\u043e\u043b\u0430 - \u043d\u043e\u043c\u0435\u0440 \u0441\u0442\u0440\u043e\u043a\u0438 \u0438 \u0441\u0442\u043e\u043b\u0431\u0446\u0430     private Dictionary&lt;char, Vector2&gt; charsDict;      public void Initialize()     {         charsDict = new Dictionary&lt;char, Vector2&gt;();         for (int i = 0; i &lt; chars.Length; i++)         {             var c = char.ToLowerInvariant(chars[i]);             if (charsDict.ContainsKey(c)) continue;             \/\/\u0420\u0430\u0441\u0447\u0435\u0442 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442 \u0441\u0438\u043c\u0432\u043e\u043b\u0430, \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u043e\u0432\u044b\u0439 \u043d\u043e\u043c\u0435\u0440 \u0441\u0438\u043c\u0432\u043e\u043b\u0430             \/\/\u0432 \u043d\u043e\u043c\u0435\u0440 \u0441\u0442\u0440\u043e\u043a\u0438 \u0438 \u0441\u0442\u043e\u043b\u0431\u0446\u0430, \u0437\u043d\u0430\u044f, \u0447\u0442\u043e \u0434\u043b\u0438\u043d\u0430 \u0441\u0442\u0440\u043e\u043a\u0438 \u0440\u0430\u0432\u043d\u0430 10.             var uv = new Vector2(i % 10, 9 - i \/ 10);             charsDict.Add(c, uv);         }     }      public Vector2 GetTextureCoordinates(char c)     {         c = char.ToLowerInvariant(c);         if (charsDict == null) Initialize();          if (charsDict.TryGetValue(c, out Vector2 texCoord))             return texCoord;         return Vector2.zero;     } } <\/code><\/pre>\n<p>  \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u043a\u043b\u0430\u0441\u0441 TextRendererParticleSystem. \u041f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 SpawnParticle, \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442\u044c \u0441\u043f\u0430\u0443\u043d \u043e\u0434\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u0438\u0446\u044b Particle System \u0432 \u043d\u0443\u0436\u043d\u0443\u044e \u043f\u043e\u0437\u0438\u0446\u0438\u044e, \u0441 \u043d\u0443\u0436\u043d\u044b\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c, \u0446\u0432\u0435\u0442\u043e\u043c \u0438 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c.<\/p>\n<pre><code class=\"cs\">[RequireComponent(typeof(ParticleSystem))] public class TextRendererParticleSystem : MonoBehaviour {     private ParticleSystemRenderer particleSystemRenderer;     private new ParticleSystem particleSystem;     public void SpawnParticle(Vector3 position, string message, Color color, float? startSize = null)     {         \/\/\u0422\u0435\u043b\u043e \u043c\u0435\u0442\u043e\u0434\u0430       } } <\/code><\/pre>\n<p>  Particle System \u0432 Unity \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0432\u0438\u0434\u0435 2\u0445 \u043f\u043e\u0442\u043e\u043a\u043e\u0432 Vector4.<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/gw\/bm\/dc\/gwbmdcxpmyhh2ogwebrz4i9qjjm.png\"><\/div>\n<p>  \u041c\u044b \u043d\u0430\u043c\u0435\u0440\u0435\u043d\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u043b\u0438\u0448\u043d\u0438\u0439 \u043f\u043e\u0442\u043e\u043a \u0441 UV2, \u0447\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u0441\u0434\u0432\u0438\u0433\u0430 \u043f\u043e \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0430\u043c \u043f\u043e\u0442\u043e\u043a\u043e\u0432. \u0415\u0441\u043b\u0438 \u044d\u0442\u043e\u0433\u043e \u043d\u0435 \u0441\u0434\u0435\u043b\u0430\u0442\u044c, \u0442\u043e \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0430\u043c X \u0438 Y Custom1-\u0432\u0435\u043a\u0442\u043e\u0440\u0430 \u0432 C# \u0431\u0443\u0434\u0443\u0442 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c Z \u0438 W TEXCOORD0 \u0448\u0435\u0439\u0434\u0435\u0440\u0430. \u0418 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, Custom1.z = TEXCOORD1.x, Custom1.w = TEXCOORD1.y. \u0427\u0442\u043e \u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442 \u043c\u043d\u043e\u0433\u043e \u043d\u0435\u0443\u0434\u043e\u0431\u0441\u0442\u0432 \u0432 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c.<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/c5\/re\/vu\/c5revuuurt5nlhhrtpj8qr4wqsu.png\"><\/div>\n<p>  \u041a\u0430\u043a \u0431\u044b\u043b\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u043e \u0440\u0430\u043d\u0435\u0435, \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0434\u043b\u0438\u043d\u044b \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0438 UV-\u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u0432\u0430 Vector4. \u0422\u0430\u043a \u043a\u0430\u043a Vector4 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 4 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0442\u0438\u043f\u0430 float, \u0442\u043e \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0443\u043f\u0430\u043a\u043e\u0432\u0430\u0442\u044c \u0432 \u043d\u0435\u0433\u043e 4 * 4 = 16 \u0431\u0430\u0439\u0442 \u0434\u0430\u043d\u043d\u044b\u0445. \u0422.\u043a. \u043d\u0430\u0448\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u0438\u043d\u0443 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f (\u0434\u0432\u0443\u0437\u043d\u0430\u0447\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e) \u0438 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 (\u0434\u0432\u0443\u0437\u043d\u0430\u0447\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0441\u0438\u043c\u0432\u043e\u043b\u0430), \u0442\u043e \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d \u0442\u0438\u043f\u0430 byte (0-255) \u0434\u043b\u044f \u043d\u0430\u0441 \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u0435\u043d. \u0412 \u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u0430\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u0435\u0441\u044f\u0442\u0438\u0447\u043d\u044b\u0445 \u0440\u0430\u0437\u0440\u044f\u0434\u043e\u0432 \u043f\u043e\u0434\u043e\u0439\u0434\u0435\u0442 \u043e\u0442\u043b\u0438\u0447\u043d\u043e.<\/p>\n<p>  \u0422\u043e\u0447\u043d\u043e\u0441\u0442\u044c float \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 6-9 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432, \u0437\u043d\u0430\u0447\u0438\u0442 \u043c\u044b \u0441\u043c\u0435\u043b\u043e \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c 6 \u0440\u0430\u0437\u0440\u044f\u0434\u043e\u0432 \u043a\u0430\u0436\u0434\u043e\u0439 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b Vector4 \u0438 \u043d\u0435 \u043f\u0435\u0440\u0435\u0436\u0438\u0432\u0430\u0442\u044c \u0437\u0430 \u0446\u0435\u043b\u043e\u0441\u0442\u043d\u043e\u0441\u0442\u044c \u0438 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0445. \u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435, \u043c\u044b \u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043b\u0438 \u043f\u0430\u043a\u043e\u0432\u0430\u0442\u044c 7, 8 \u0438 9 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432, \u043d\u043e \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438 float \u043d\u0435 \u0445\u0432\u0430\u0442\u0430\u0435\u0442.<\/p>\n<p>  \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0432 \u043a\u0430\u0436\u0434\u044b\u0439 float, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0434\u0435\u0441\u044f\u0442\u0438\u0447\u043d\u044b\u0435 \u0440\u0430\u0437\u0440\u044f\u0434\u044b, \u043c\u044b \u0443\u043f\u0430\u043a\u0443\u0435\u043c \u0446\u0435\u043b\u044b\u0445 6 \u0446\u0438\u0444\u0440, \u0432 \u043e\u0442\u043b\u0438\u0447\u0438\u0438 \u043e\u0442 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0433\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430 \u0441 \u0447\u0435\u0442\u044b\u0440\u044c\u043c\u044f \u0431\u0430\u0439\u0442\u0430\u043c\u0438. \u0418\u0442\u043e\u0433\u043e, \u043e\u0434\u0438\u043d Vector4 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c 24 \u043e\u0434\u043d\u043e\u0437\u043d\u0430\u0447\u043d\u044b\u0445 \u0447\u0438\u0441\u043b\u0430.<\/p>\n<p>  \u041c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0432 \u043f\u043e\u0442\u043e\u043a\u0435 2 \u0432\u0435\u043a\u0442\u043e\u0440\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0431\u0430 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0434\u043b\u0438\u043d\u043e\u0439 \u0434\u043e 23 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432: <\/p>\n<p>  Custom1.xyzw \u2014 \u043f\u0435\u0440\u0432\u044b\u0435 12 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f.<br \/>  Custom2.xyzw \u2014 \u0435\u0449\u0435 11 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f + \u0434\u043b\u0438\u043d\u0430 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f (\u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 2 \u0441\u0438\u043c\u0432\u043e\u043b\u0430).<\/p>\n<p>  \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u00abHello\u00bb \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c.<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/g3\/nm\/tj\/g3nmtjvqme40jjcrw-ear7hwnoo.png\"><\/div>\n<p>  \u041a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0430\u043c \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u043d\u043e\u043c\u0435\u0440 \u0441\u0442\u043e\u043b\u0431\u0446\u0430 \u0438 \u0441\u0442\u0440\u043e\u043a\u0430 \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0441\u0438\u043c\u0432\u043e\u043b\u0430 \u0432 \u0442\u0435\u043a\u0441\u0442\u0443\u0440\u0435.<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/47\/9h\/d6\/479hd6qetusenhgjdafodmsgk7u.png\"><\/div>\n<p>  \u0412 \u043a\u043e\u0434\u0435 \u0443\u043f\u0430\u043a\u043e\u0432\u043a\u0430 \u0441\u0442\u0440\u043e\u043a\u0438 \u0432 \u0434\u0432\u0430 Vector4 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"cs\">\/\/\u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0443\u043f\u0430\u043a\u043e\u0432\u043a\u0438 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 Vector2 \u0441 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0430\u043c\u0438 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u0432\u043e float public float PackFloat(Vector2[] vecs) {     if (vecs == null || vecs.Length == 0) return 0;                 \/\/\u041f\u043e\u0440\u0430\u0437\u0440\u044f\u0434\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442 \u0432\u0435\u043a\u0442\u043e\u0440\u043e\u0432 \u0432 float     var result = vecs[0].y * 10000 + vecs[0].x * 100000;     if (vecs.Length &gt; 1) result += vecs[1].y * 100 + vecs[1].x * 1000;     if (vecs.Length &gt; 2) result += vecs[2].y + vecs[2].x * 10;                     return result; }  \/\/\u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f Vector4 \u0434\u043b\u044f \u043f\u043e\u0442\u043e\u043a\u0430 \u0441 CustomData private Vector4 CreateCustomData(Vector2[] texCoords, int offset = 0) {     var data = Vector4.zero;                 for (int i = 0; i &lt; 4; i++)     {         var vecs = new Vector2[3];                         for (int j = 0; j &lt; 3; j++)         {             var ind = i * 3 + j + offset;             if (texCoords.Length &gt; ind)             {                 vecs[j] = texCoords[ind];             }             else             {                 data[i] = PackFloat(vecs);                 i = 5;                  break;             }         }         if (i &lt; 4) data[i] = PackFloat(vecs);     }     return data; }  \/\/\u0414\u043e\u043f\u043e\u043b\u043d\u0438\u043c \u0442\u0435\u043b\u043e \u043c\u0435\u0442\u043e\u0434\u0430 \u0441\u043f\u0430\u0443\u043d\u0430 \u0447\u0430\u0441\u0442\u0438\u0446\u044b public void SpawnParticle(Vector3 position, string message, Color color, float? startSize = null) {     var texCords = new Vector2[24]; \/\/\u043c\u0430\u0441\u0441\u0438\u0432 \u0438\u0437 24 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 - 23 \u0441\u0438\u043c\u0432\u043e\u043b\u0430 + \u0434\u043b\u0438\u043d\u0430 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f     var messageLenght = Mathf.Min(23, message.Length);     texCords[texCords.Length - 1] = new Vector2(0, messageLenght);     for (int i = 0; i &lt; texCords.Length; i++)     {         if (i &gt;= messageLenght) break;         \/\/\u0412\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u043c\u0435\u0442\u043e\u0434 GetTextureCoordinates() \u0438\u0437 SymbolsTextureData \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043f\u043e\u0437\u0438\u0446\u0438\u0438 \u0441\u0438\u043c\u0432\u043e\u043b\u0430         texCords[i] = textureData.GetTextureCoordinates(message[i]);     } \t\t     var custom1Data = CreateCustomData(texCords);     var custom2Data = CreateCustomData(texCords, 12); } <\/code><\/pre>\n<p>  \u0412\u0435\u043a\u0442\u043e\u0440\u0430 \u0441 CustomData \u0433\u043e\u0442\u043e\u0432\u044b. \u041f\u0440\u0438\u0448\u043b\u043e \u0432\u0440\u0435\u043c\u044f \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u0437\u0430\u0441\u043f\u0430\u0443\u043d\u0438\u0442\u044c \u043d\u043e\u0432\u0443\u044e \u0447\u0430\u0441\u0442\u0438\u0446\u0443 \u0441 \u043d\u0443\u0436\u043d\u044b\u043c\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438.<\/p>\n<p>  <b>\u0421\u043f\u0430\u0443\u043d \u0447\u0430\u0441\u0442\u0438\u0446\u044b<\/b><\/p>\n<p>  \u041f\u0435\u0440\u0432\u043e\u0435, \u0447\u0442\u043e \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c, \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e CustomData \u043f\u043e\u0442\u043e\u043a\u0438 \u0430\u043a\u0442\u0438\u0432\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u0445 Renderer \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0447\u0430\u0441\u0442\u0438\u0446:<\/p>\n<pre><code class=\"cs\">\/\/\u041a\u044d\u0448\u0438\u0440\u0443\u0435\u043c \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 ParticleSystem if (particleSystem == null) particleSystem = GetComponent&lt;ParticleSystem&gt;();  if (particleSystemRenderer == null) {     \/\/\u0415\u0441\u043b\u0438 \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 ParticleSystemRenderer, \u043a\u044d\u0448\u0438\u0440\u0443\u0435\u043c \u0438 \u0443\u0431\u0435\u0436\u0434\u0430\u0435\u043c\u0441\u044f \u0432 \u043d\u0430\u043b\u0438\u0447\u0438\u0438 \u043d\u0443\u0436\u043d\u044b\u0445 \u043f\u043e\u0442\u043e\u043a\u043e\u0432     particleSystemRenderer = particleSystem.GetComponent&lt;ParticleSystemRenderer&gt;();     var streams = new List&lt;ParticleSystemVertexStream&gt;();     particleSystemRenderer.GetActiveVertexStreams(streams);     \/\/\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043b\u0438\u0448\u043d\u0438\u0439 \u043f\u043e\u0442\u043e\u043a Vector2(UV2, SizeXY, etc.), \u0447\u0442\u043e\u0431\u044b \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u0432 \u0441\u043a\u0440\u0438\u043f\u0442\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u043b\u0438 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0430\u043c \u0432 \u0448\u0435\u0439\u0434\u0435\u0440\u0435     if (!streams.Contains(ParticleSystemVertexStream.UV2)) streams.Add(ParticleSystemVertexStream.UV2);     if (!streams.Contains(ParticleSystemVertexStream.Custom1XYZW)) streams.Add(ParticleSystemVertexStream.Custom1XYZW);     if (!streams.Contains(ParticleSystemVertexStream.Custom2XYZW)) streams.Add(ParticleSystemVertexStream.Custom2XYZW);     particleSystemRenderer.SetActiveVertexStreams(streams); } <\/code><\/pre>\n<p>  \u0414\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0447\u0430\u0441\u0442\u0438\u0446\u044b \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u043c\u0435\u0442\u043e\u0434\u043e\u043c Emit() \u043a\u043b\u0430\u0441\u0441\u0430 ParticleSystem.<\/p>\n<pre><code class=\"cs\">\/\/\u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u044d\u043c\u043c\u0438\u0448\u0435\u043d\u0430 \/\/\u0426\u0432\u0435\u0442 \u0438 \u043f\u043e\u0437\u0438\u0446\u0438\u044e \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0438\u0437 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043c\u0435\u0442\u043e\u0434\u0430 \/\/\u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c startSize3D \u043f\u043e X, \u0447\u0442\u043e\u0431\u044b \u0441\u0438\u043c\u0432\u043e\u043b\u044b \u043d\u0435 \u0440\u0430\u0441\u0442\u044f\u0433\u0438\u0432\u0430\u043b\u0438\u0441\u044c \u0438 \u043d\u0435 \u0441\u0436\u0438\u043c\u0430\u043b\u0438\u0441\u044c \/\/\u043f\u0440\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u0434\u043b\u0438\u043d\u044b \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f var emitParams = new ParticleSystem.EmitParams {     startColor = color,     position = position,     applyShapeToPosition = true,     startSize3D = new Vector3(messageLenght, 1, 1) }; \/\/\u0415\u0441\u043b\u0438 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0447\u0430\u0441\u0442\u0438\u0446\u044b \u0440\u0430\u0437\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0430, \u0442\u043e \u0432 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u0445 SpawnParticle \u043d\u0435\u043e\u0445\u043e\u0434\u0438\u043c\u043e \/\/\u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u043d\u0443\u0436\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 startSize if (startSize.HasValue) emitParams.startSize3D *= startSize.Value * particleSystem.main.startSizeMultiplier; \/\/\u041d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0441\u043f\u0430\u0443\u043d \u0447\u0430\u0441\u0442\u0438\u0446\u044b particleSystem.Emit(emitParams, 1);  \/\/\u041f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u043d\u0443\u0436\u043d\u044b\u0435 \u043f\u043e\u0442\u043e\u043a\u0438 var customData = new List&lt;Vector4&gt;(); \/\/\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043f\u043e\u0442\u043e\u043a ParticleSystemCustomData.Custom1 \u0438\u0437 ParticleSystem particleSystem.GetCustomParticleData(customData, ParticleSystemCustomData.Custom1); \/\/\u041c\u0435\u043d\u044f\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442, \u0442.\u0435. \u0442\u043e\u0439 \u0447\u0430\u0441\u0442\u0438\u0446\u044b, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u043b\u0438 customData[customData.Count - 1] = custom1Data; \/\/\u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 ParticleSystem particleSystem.SetCustomParticleData(customData, ParticleSystemCustomData.Custom1);  \/\/\u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u0434\u043b\u044f ParticleSystemCustomData.Custom2 particleSystem.GetCustomParticleData(customData, ParticleSystemCustomData.Custom2);             customData[customData.Count - 1] = custom2Data; particleSystem.SetCustomParticleData(customData, ParticleSystemCustomData.Custom2); <\/code><\/pre>\n<p>  \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u043e\u0431\u0430 \u0431\u043b\u043e\u043a\u0430 \u0432 \u043c\u0435\u0442\u043e\u0434 SpawnParticle() \u0438 C# \u0447\u0430\u0441\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u0430: \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0443\u043f\u0430\u043a\u043e\u0432\u0430\u043d\u043e \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043e GPU \u0432 \u0432\u0438\u0434\u0435 \u0434\u0432\u0443\u0445 Vector4 \u0432 Vertex Stream. \u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0441\u0430\u043c\u043e\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0435 \u2014 \u043f\u0440\u0438\u043d\u044f\u0442\u044c \u044d\u0442\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c.<\/p>\n<p>  <b>\u041a\u043e\u0434 \u0448\u0435\u0439\u0434\u0435\u0440\u0430<\/b><\/p>\n<pre><code class=\"plaintext\">Shader &quot;Custom\/TextParticles&quot; {     Properties     {         _MainTex (&quot;Texture&quot;, 2D) = &quot;white&quot; {}         \/\/\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0442\u0440\u043e\u043a \u0438 \u0441\u0442\u043e\u043b\u0431\u0446\u043e\u0432 \u0432 \u0442\u0435\u043e\u0440\u0438\u0438 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043c\u0435\u043d\u044c\u0448\u0435 10, \u043d\u043e \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u0431\u043e\u043b\u044c\u0448\u0435         _Cols (&quot;Columns Count&quot;, Int) = 10         _Rows (&quot;Rows Count&quot;, Int) = 10     }     SubShader     {                     Tags { &quot;RenderType&quot;=&quot;Opaque&quot; &quot;PreviewType&quot;=&quot;Plane&quot; &quot;Queue&quot; = &quot;Transparent+1&quot;}         LOD 100         ZWrite Off         Blend SrcAlpha OneMinusSrcAlpha          Pass         {             CGPROGRAM             #pragma vertex vert             #pragma fragment frag                          #include &quot;UnityCG.cginc&quot;                          struct appdata             {                 float4 vertex : POSITION;                 fixed4 color : COLOR;                 float4 uv : TEXCOORD0;                 \/\/\u0422\u0435 \u0441\u0430\u043c\u044b\u0435 \u0432\u0435\u043a\u0442\u043e\u0440\u0430 \u0441 customData                 float4 customData1 : TEXCOORD1;                 float4 customData2 : TEXCOORD2;             };                         struct v2f             {                 float4 vertex : SV_POSITION;                 fixed4 color : COLOR;                 float4 uv : TEXCOORD0;                 float4 customData1 : TEXCOORD1;                 float4 customData2 : TEXCOORD2;             };                          uniform sampler2D _MainTex;             uniform uint _Cols;             uniform uint _Rows;                          v2f vert (appdata v)             {                 v2f o;                 \/\/\u041f\u043e\u0447\u0435\u043c\u0443 \u0434\u043b\u0438\u043d\u0430 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f \u0438\u043c\u0435\u043d\u043d\u043e \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0445 \u0440\u0430\u0437\u0440\u044f\u0434\u0430\u0445 w-\u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u0432\u0435\u043a\u0442\u043e\u0440\u0430?                 \/\/\u0422\u0430\u043a \u043f\u0440\u043e\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u044d\u0442\u0443 \u0434\u043b\u0438\u043d\u0443 \u0432\u043d\u0443\u0442\u0440\u0438 \u0448\u0435\u0439\u0434\u0435\u0440\u0430.                 \/\/\u0414\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043e\u0441\u0442\u0430\u0442\u043e\u043a \u043e\u0442 \u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043d\u0430 100.                 float textLength = ceil(fmod(v.customData2.w, 100));                  o.vertex = UnityObjectToClipPos(v.vertex);                 \/\/\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0440\u0430\u0437\u043c\u0435\u0440 UV \u0442\u0435\u043a\u0441\u0442\u0443\u0440\u044b, \u0438\u0441\u0445\u043e\u0434\u044f \u0438\u0437 \u043a\u043e\u043b-\u0432\u0430 \u0441\u0442\u0440\u043e\u043a \u0438 \u0441\u0442\u043e\u043b\u0431\u0446\u043e\u0432                 o.uv.xy = v.uv.xy * fixed2(textLength \/ _Cols, 1.0 \/ _Rows);                 o.uv.zw = v.uv.zw;                 o.color = v.color;                                 o.customData1 = floor(v.customData1);                 o.customData2 = floor(v.customData2);                 return o;             }                          fixed4 frag (v2f v) : SV_Target             {                 fixed2 uv = v.uv.xy;                 \/\/\u0418\u043d\u0434\u0435\u043a\u0441 \u0441\u0438\u043c\u0432\u043e\u043b\u0430 \u0432 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0438                 uint ind = floor(uv.x * _Cols);                  uint x = 0;                 uint y = 0;                  \/\/\u0418\u043d\u0434\u0435\u043a\u0441 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u0432\u0435\u043a\u0442\u043e\u0440\u0430, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 \u044d\u0442\u043e\u0442 \u044d\u043b\u0435\u043c\u0435\u043d\u0442                 \/\/0-3 - customData1                 \/\/4-7 - customData2                 uint dataInd = ind \/ 3;                 \/\/\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432\u0441\u0435\u0445 6 \u0440\u0430\u0437\u0440\u044f\u0434\u043e\u0432 \u0443\u043f\u0430\u043a\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0432 \u043d\u0443\u0436\u043d\u044b\u0439 float                 uint sum = dataInd &lt; 4 ? v.customData1[dataInd] : v.customData2[dataInd - 4];                  \/\/\u041d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0440\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u043a\u0430 float \u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 \u0438 \u0441\u0442\u043e\u043b\u0431\u0446\u0430 \u0441\u0438\u043c\u0432\u043e\u043b\u0430                 for(int i = 0; i &lt; 3; ++i)                 {                     if (dataInd &gt; 3 &amp; i == 3) break;                     \/\/\u043e\u043a\u0440\u0443\u0433\u043b\u044f\u0435\u043c \u0434\u043e \u0431\u043e\u043b\u044c\u0448\u0435\u0433\u043e, \u0438\u043d\u0430\u0447\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043c 10^2 = 99 \u0438 \u0442.\u0434.                     uint val = ceil(pow(10, 5 - i * 2));                     x = sum \/ val;                     sum -= x * val;                      val = ceil(pow(10, 4 - i * 2));                     y = sum \/ val;                     sum -= floor(y * val);                      if (dataInd * 3 + i == ind) i = 3;                 }                                  float cols = 1.0 \/ _Cols;                 float rows = 1.0 \/ _Rows;                 \/\/\u0421\u0434\u0432\u0438\u0433\u0430\u0435\u043c UV-\u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043a\u043e\u043b-\u0432\u043e \u0441\u0442\u0440\u043e\u043a, \u0441\u0442\u043e\u043b\u0431\u0446\u043e\u0432, \u0438\u043d\u0434\u0435\u043a\u0441                 \/\/\u0438 \u043d\u043e\u043c\u0435\u0440 \u0441\u0442\u0440\u043e\u043a\u0438 \u0438 \u0441\u0442\u043e\u043b\u0431\u0446\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430                 uv.x += x * cols - ind * rows;                 uv.y += y * rows;                                  return tex2D(_MainTex, uv.xy) * v.color;             }             ENDCG         }     } } <\/code><\/pre>\n<p>  <b>\u0420\u0435\u0434\u0430\u043a\u0442\u043e\u0440 Unity<\/b><\/p>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b \u0438 \u043d\u0430\u0437\u043d\u0430\u0447\u0430\u0435\u043c \u0435\u043c\u0443 \u043d\u0430\u0448 \u0448\u0435\u0439\u0434\u0435\u0440. \u041d\u0430 \u0441\u0446\u0435\u043d\u0435 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043e\u0431\u044a\u0435\u043a\u0442 \u0441 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u043c ParticleSystem, \u043d\u0430\u0437\u043d\u0430\u0447\u0430\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b. \u0417\u0430\u0442\u0435\u043c \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0447\u0430\u0441\u0442\u0438\u0446 \u0438 \u043e\u0442\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 Play On Awake. \u0418\u0437 \u043b\u044e\u0431\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u043c\u0435\u0442\u043e\u0434 AmountRendererParticleSystem.SpawnParticle() \u0438\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0434\u0435\u0431\u0430\u0436\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434.<\/p>\n<pre><code class=\"cs\">[ContextMenu(&quot;TestText&quot;)] public void TestText() {     SpawnParticle(transform.position, &quot;Hello world!&quot;, Color.red); } <\/code><\/pre>\n<p>  \u0421 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c, \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c\u0438 \u0438 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f <a href=\"https:\/\/github.com\/timur-pub\/textparticles\">\u0437\u0434\u0435\u0441\u044c<\/a>.<\/p>\n<p>  <b>\u0421\u0438\u0441\u0442\u0435\u043c\u0430 \u0432\u044b\u0432\u043e\u0434\u0430 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u0432 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0438<\/b><\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/f8d\/91e\/a20\/f8d91ea20610d787563e72398802cccd.gif\" alt=\"image\"><\/div>\n<p>  \u0412\u043e\u0442 \u0438 \u0432\u0441\u0435. \u0412\u044b\u0432\u043e\u0434 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Particle System \u0433\u043e\u0442\u043e\u0432! \u041d\u0430\u0434\u0435\u0435\u043c\u0441\u044f, \u044d\u0442\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043f\u0440\u0438\u043d\u0435\u0441\u0435\u0442 \u043f\u043e\u043b\u044c\u0437\u0443 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c \u0438\u0433\u0440 \u043d\u0430 Unity.<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/486260\/\"> https:\/\/habr.com\/ru\/post\/486260\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/486260\/\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/74b\/904\/6a5\/74b9046a520d2199cfc062791bdc1cc5.jpg\" alt=\"image\"><\/p>\n<h4>\u0417\u0430\u0434\u0430\u0447\u0430<\/h4>\n<p>  \u041f\u0440\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043d\u0430\u0448\u0435\u0439 \u0438\u0433\u0440\u044b The Unliving, \u043c\u044b \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u043b\u0438 \u043f\u0435\u0440\u0435\u0434 \u0441\u043e\u0431\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0443 \u043f\u043e \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044e \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439, \u0442\u0430\u043a\u0438\u0445, \u043a\u0430\u043a \u043d\u0430\u043d\u0435\u0441\u0435\u043d\u043d\u044b\u0439 \u0443\u0440\u043e\u043d, \u043d\u0435\u0445\u0432\u0430\u0442\u043a\u0430 \u0437\u0434\u043e\u0440\u043e\u0432\u044c\u044f \u0438\u043b\u0438 \u044d\u043d\u0435\u0440\u0433\u0438\u0438, \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u0430 \u043d\u0430\u0433\u0440\u0430\u0434\u044b, \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0445 \u043e\u0447\u043a\u043e\u0432 \u0437\u0434\u043e\u0440\u043e\u0432\u044c\u044f \u0438 \u0442.\u0434., \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Particle System. \u042d\u0442\u043e \u0431\u044b\u043b\u043e \u0440\u0435\u0448\u0435\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 \u0434\u043b\u044f \u043a\u0430\u0441\u0442\u043e\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u044d\u0444\u0444\u0435\u043a\u0442\u043e\u0432 \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u0438 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0433\u043e \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0442\u0430\u043a\u0438\u0445 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439, \u0447\u0442\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u0442\u0438\u0447\u043d\u043e \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 UI-\u0441\u0438\u0441\u0442\u0435\u043c\u044b Unity.<\/p>\n<p>  \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0434\u0430\u043d\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043f\u043e\u0434\u0440\u0430\u0437\u0443\u043c\u0435\u0432\u0430\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0432\u0441\u0435\u0433\u043e \u043b\u0438\u0448\u044c \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u043d\u0441\u0442\u0430\u043d\u0441\u0430 Particle System \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0442\u0438\u043f\u0430 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439, \u0447\u0442\u043e \u0434\u0430\u0435\u0442 \u043e\u0433\u0440\u043e\u043c\u043d\u044b\u0439 \u043f\u0440\u0438\u0440\u043e\u0441\u0442 \u0432 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043f\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e \u0441 \u0432\u044b\u0432\u043e\u0434\u043e\u043c \u044d\u0442\u0438\u0445 \u0436\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Unity UI.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-297955","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/297955","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=297955"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/297955\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=297955"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=297955"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=297955"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}