Skip to content

Instantly share code, notes, and snippets.

View lucasmeijer's full-sized avatar

Lucas Meijer lucasmeijer

View GitHub Profile
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;
namespace Unity.Il2CPP.Builders
{
public class SimpleExecutable : BuiltProgram
{
private readonly string _path;
@lucasmeijer
lucasmeijer / gist:e7bb3a981c2b2887642d
Created January 9, 2015 09:20
Can you write a better version?
using System;
using System.Collections.Generic;
using System.Linq;
class Experiment
{
//ErrorsFor takes a hayStack, a bunch of needles, and is supposed to invoke errorMessage generator for everything
//in the haystack that matches a certain needle. As an excersice, i've been trying out all the different ways
//to write it, and evaluate for clarity, conciceness, readability by others, readability by me.
//
using ICSharpCode.Decompiler.Ast.Transforms;
using cil2as.Configuration;
using cil2as.Decompiler.Transforms;
using cil2as.Decompiler.Transforms.Generics;
namespace cil2as.Decompiler
{
class ActionScriptTransformationPipelineProvider : ITransformationPipelineProvider
{
private readonly ServiceProvider _serviceProvider;
//cl.exe main.cpp errors out witha link error, because booya() is an unresolved symbol.
//it is not actually used by the program however. is there a trick to make it only complain about unresolved symbols
//that actually end up being needed to run the program?
extern void booya();
void NotActuallyUsed()
{
booya();
}
static void
thread_end (MonoProfiler *prof, gsize tid)
{
MonoInternalThread *thread;
DebuggerTlsData *tls = NULL;
mono_loader_lock ();
thread = mono_g_hash_table_lookup (tid_to_thread, (gpointer)tid);
if (thread) {
tls = mono_g_hash_table_lookup (thread_to_tls, thread);
using System;
using System.Collections.Generic;
class Camera {}
struct UnityList<T>
{
T[] _cameras;
public MyEnumerator GetEnumerator()
public class SerializationCallbackInCustomStruct : RuntimeTest
{
public class SerializationCallbackInCustomStructScript : MonoBehaviour
{
[Serializable]
public struct Custom : INotifyOnSerialization
{
public int myint;
public int myint2;
public int myint3;
using System;
using NUnit.Framework;
using Unity.RuntimeTests.Framework;
using UnityEngine;
using RuntimePlatform = UnityEngine.Common.Enums.RuntimePlatform;
namespace Unity.RuntimeTests.SerializationTests.Callback
{
[TestFixture]
[ExcludePlatform(RuntimePlatform.FlashPlayer, ExcludePlatformAttribute.ExclusionReason.NotSupported, "this feature was introduced after announcing flash EOL")]
[DataVersion(2)]
public MyClass : MonoBehaviour
{
public float m_myFloatThatUsedToBeAnInt;
}
#if UNITY_EDITOR
static class DataUpdater
{
[DataUpdaterFor(typeof(MyClass))]
public MyClass : MonoBehaviour, IWantToHandleDeserializationOfOldDataMyself
{
public float m_myFloatThatUsedToBeAnInt;
#if UNITY_EDITOR
static void DeserializeOldData(SerializedObject oldData, SerializedObject newData)
{
}
#endif
}