This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Через сколько времени удастся перехватить равномерно двигающуюся цель, | |
/// если мы будем двигаться в место встречи со скоростью mySpeed | |
/// </summary> | |
/// <param name="targetPosition">текущее положение цели</param> | |
/// <param name="targetSpeed">вектор движения цели</param> | |
/// <param name="myPosition">наше текущее положение</param> | |
/// <param name="mySpeed">наша скорость движения</param> | |
/// <returns>через сколько времени встретимся. | |
/// Место встречи: targetPosition + targetSpeed*t</returns> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:: Во всех .html файлах в папке DEST_PATH добавит к ссылкам на скрипты и картинки | |
:: их crc32-сумму через знак вопроса, что гарантирует загрузку файла | |
:: не из кеша браузера, если он изменился с последней заливкой | |
:: | |
:: Например: | |
:: <link rel="stylesheet" href="css/main.css"> | |
:: <script type="text/javascript" src="/js/main.js"></script> | |
:: <img src="img/ui/lock.png"> | |
:: Заменится на: | |
:: <link rel="stylesheet" href="css/main.css?2201884646"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Расчет угла выстрела для движения снаряда по параболической траектории | |
/// From: https://www.habrador.com/tutorials/unity-realistic-bullets/2-targeting/ | |
/// </summary> | |
/// <param name="bulletSpeed">Скорость пули</param> | |
/// <param name="deltaTarget">Относительное положение цели</param> | |
/// <param name="higherTrajectory">два угла могут дать одинаковый результат, true - по большой параболе, false - по низкой</param> | |
/// <param name="gravity">ускорение гравитации</param> | |
/// <returns> | |
/// >=0 Угол выстрела |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=== https://en.wikipedia.org/wiki/Wikipedia:Language_recognition_chart | |
ABCDEFGHIJKLMNOPQRSTUVWXYZ – Latin alphabet | |
àéëïij – Dutch | |
áêéèëïíîôóúû – Afrikaans | |
êôúû – West Frisian | |
ÆØÅæøå – Danish, Norwegian | |
ÄÖäö – Finnish (BCDFGQWXZÅbcfgqwxzå only found in names and loanwords, occasionally also ŠšŽž) | |
ÅÄÖåäö – Swedish (occasionally é) | |
ÄÖÕÜäöõü – Estonian | |
ÄÖÜäöüß – German |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Reflection; | |
using System.Text; | |
using UnityEngine; | |
/// <summary> | |
/// Dump configuration |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static string ReplaceQuotes(string s) { | |
var quotes = new[] { "«", "»" }; | |
int n = 0; | |
while (true) { | |
int i = s.IndexOf("\"", StringComparison.Ordinal); | |
if (i < 0) break; | |
s = s.Substring(0, i) + quotes[n++%quotes.Length] + s.Substring(i + 1); | |
} | |
return s; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Number of changes needed to turn one string into another. | |
/// Taken from https://www.dotnetperls.com/levenshtein | |
/// </summary> | |
public static int LevenshteinDistanceTo(string s, string t) | |
{ | |
int n = s.Length; | |
int m = t.Length; | |
if (n == 0) return m; | |
if (m == 0) return n; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.IO; | |
public static class ProcessExecute { | |
public static int Execute(string command, string arguments, out string output, out string error, string input = null) { | |
var proc = new System.Diagnostics.Process(); | |
proc.StartInfo.UseShellExecute = false; | |
if (!string.IsNullOrEmpty(input)) | |
proc.StartInfo.RedirectStandardInput = true; | |
proc.StartInfo.RedirectStandardError = true; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
public static class AppInfo { | |
//--- AutoGenerated.begin | |
public const string Version = "1.0.3"; | |
public static readonly DateTime Date = new DateTime(2018, 04, 29, 13, 41, 08, 331, DateTimeKind.Utc); | |
//--- AutoGenerated.end | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Если при компиляции под Android получается ошибка: Too many field references | |
По совету: http://answers.unity3d.com/questions/970713/too-many-method-references-max-is-65536.html | |
Надо объединить какие-нибудь модули в одном package | |
1. Выбрать жертву (например, модули от firebase) | |
2. Раскрыть все .aar архивы, после компиляции (даже неудачной) взять | |
раскрытые из .\Temp\StagingArea\android-libraries\ и положить их вместо .aar | |
3. Заменить в каждом из раскрытых AndroidManifest.xml тег "package" на "com.google.unity" | |
чтобы объединились вместе с модулями Google play (games или ads) |
NewerOlder