View GenerateLinkXml.cs
using UnityEditor.Build.Pipeline; | |
using UnityEditor.Build.Pipeline.Injector; | |
using UnityEditor.Build.Pipeline.Interfaces; | |
public class GenerateLinkXml : IBuildTask | |
{ | |
public static readonly string LinkXmlFilename = "link.xml"; | |
public int Version { get { return 1; } } |
View gist:63ced16b9033108a9574bb953969553a
// Source: https://forum.unity.com/threads/binary-protocol-specification.417831/ | |
//all 16 and 32 bit data are network ordered | |
//message length occupy 1 byte length if first bit == 0 or 2 bytes if it equal 1: | |
int SetLength(char* buffer, uint16_t messageLength) | |
{ | |
int messageLengthSize = (messageLength > 0x7F) ? 2 : 1; | |
if (messageLengthSize == 1) | |
{ | |
*buffer = (uint8_t)messageLength; |
View CSharpProjectProcessor.cs
using UnityEngine; | |
using UnityEditor; | |
using System; | |
using System.IO; | |
public class CSharpProjectProcessor : AssetPostprocessor | |
{ | |
[MenuItem("Assets/Clean MonoDevelop Files")] | |
static void CleanMonoDevelopFiles() | |
{ |
View Singletons.cs
using UnityEngine; | |
namespace Framework | |
{ | |
/// <summary> | |
/// Simple singleton, automatically find a instance and caches it | |
/// Implementors should make all public methods and properties as static and access Instance | |
/// </summary> | |
public abstract class Singleton<T> : MonoBehaviour where T: MonoBehaviour | |
{ |
View gist:5230032
// Adjust dSYM generation | |
var xcodeProjectPath = Path.Combine(xcodeProjectDir, "Unity-iPhone.xcodeproj"); | |
var pbxPath = Path.Combine(xcodeProjectPath, "project.pbxproj"); | |
var sb = new System.Text.StringBuilder(); | |
var xcodeProjectLines = File.ReadAllLines(pbxPath); | |
foreach (var line in xcodeProjectLines) | |
{ | |
// Remove from OTHER_LDFLAGS |