Skip to content

Instantly share code, notes, and snippets.

View ZimM-LostPolygon's full-sized avatar

Serhii Yolkin ZimM-LostPolygon

View GitHub Profile
@ZimM-LostPolygon
ZimM-LostPolygon / UnityGuidRegenerator.cs
Last active June 3, 2024 07:38
Unity asset GUIDs regenerator
// Drop into Assets/Editor, use "Tools/Regenerate asset GUIDs"
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using UnityEditor;
namespace UnityGuidRegenerator {
public class UnityGuidRegeneratorMenu {
PHP script that uses Unity Publisher API for PHP (https://github.com/LostPolygon/Unity-Publisher-API-PHP) to retrieve new asset sales, put them into a MySQL database, and notify about the sales via e-mail.
Data is inserted into `sales` table, which can be created from sales_table.sql file. Just set up the credentials and put this script on cron with whatever interval you want. Delete the email notification part if you don't need it.
Requires PHP 5.4, php_json extension, and remote socket access.
Also, I know it's ugly, but it does the job and served me well for over a year.
@ZimM-LostPolygon
ZimM-LostPolygon / GUIDGenerator .cs
Created March 22, 2015 18:05
Random GUID string generator
public static class GUIDGenerator {
public static string NewGuid() {
return Guid.NewGuid().ToString();
Random random = new Random();
StringBuilder guidBuilder = new StringBuilder(8 + 4 + 4 + 4 + 12 + 4);
AppendRandomInt(random, guidBuilder);
guidBuilder.Append('-');
AppendRandomShort(random, guidBuilder);
guidBuilder.Append('-');
AppendRandomShort(random, guidBuilder);
@ZimM-LostPolygon
ZimM-LostPolygon / UnityVersionParser.cs
Created September 30, 2015 19:41
Unity version parser
using System;
using System.Text.RegularExpressions;
namespace LostPolygon.Shared {
internal class UnityVersionParser {
private readonly int _versionMajor = -1;
private readonly int _versionMinor = -1;
private readonly int _versionPatch = -1;
private readonly UnityBuildType _versionBuildType = UnityBuildType.Unknown;
private readonly int _versionReleaseNumber = -1;
@ZimM-LostPolygon
ZimM-LostPolygon / ExternalReferenceLinksProviderComponent.cs
Created May 4, 2017 19:30
A simple SandCastle BuildComponent for replacing unknown type references with links from XML database
using System;
using System.Collections.Generic;
using System.ComponentModel.Composition.Hosting;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Windows.Forms;
using System.Xml;
using System.Xml.Linq;
@ZimM-LostPolygon
ZimM-LostPolygon / AddSystemNumericsToCsProjectPostprocessor.cs
Created July 7, 2018 16:55
Editor script that adds System.Numerics assembly reference to Unity-generated C# projects
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Xml.Linq;
using UnityEditor;
namespace Loom.Unity3d.Internal.Editor
{
/// <summary>
/// Adds System.Numerics assembly reference to Unity-generated C# projects.