Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Just chillin'

Lior Tal liortal53

💭
Just chillin'
View GitHub Profile
View LogAssertEx.cs
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
using UnityEditor.TestTools.TestRunner.Api;
using UnityEngine;
using UnityEngine.TestTools;
namespace UnityTestExtensions
{
/// <summary>
@liortal53
liortal53 / EmbedPackage.cs
Created Oct 25, 2019
Embed package into your Unity project to modify the code more easily :)
View EmbedPackage.cs
using System.IO;
using UnityEditor.PackageManager;
using UnityEngine;
namespace UnityEditor.Extensions
{
#if UNITY_2017_3_OR_NEWER
/// <summary>
/// Editor extension for embedding packages as a local copy in the project.
View EmbedPackage.cs
using System.IO;
using UnityEditor.PackageManager;
using UnityEngine;
namespace UnityEditor.Extensions
{
#if UNITY_2017_3_OR_NEWER
/// <summary>
/// Editor extension for embedding packages as a local copy in the project.
View EmbedPackage.cs
using System.IO;
using UnityEditor.PackageManager;
using UnityEngine;
namespace UnityEditor.Extensions
{
/// <summary>
/// Editor extension for embedding packages as a local copy in the project.
/// This can be useful in case you want to modify the package's source code.
/// </summary>
@liortal53
liortal53 / Deadlock.txt
Created Jun 8, 2016
Android thread dump of a deadlock in Facebook Android SDK (AppEventsLogger)
View Deadlock.txt
1 12139 Runnable 949 378 main
at com.unity3d.player.UnityPlayer.UnitySendMessage(Native Method)
at com.androidnative.AndroidNativeBridge.onStop(AndroidNativeBridge.java:186)
at android.app.Instrumentation.callActivityOnStop(Instrumentation.java:1278)
at android.app.Activity.performStop(Activity.java:6395)
at android.app.ActivityThread.handleSleeping(ActivityThread.java:3621)
at android.app.ActivityThread.-wrap19(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1519)
at android.os.Handler.dispatchMessage(Handler.java:102)
@liortal53
liortal53 / PostBuildHelper.cs
Created Jan 28, 2016
Unity: Auto increment iOS build number post build
View PostBuildHelper.cs
using System.IO;
using System.Linq;
using UnityEditor;
using UnityEditor.Callbacks;
using UnityEditor.iOS.Xcode;
using UnityEngine;
public static class PostBuildHelper
{
[PostProcessBuild]
@liortal53
liortal53 / ConsoleRouter.cs
Last active Dec 25, 2020
Redirect Console output to Unity's console
View ConsoleRouter.cs
using System.IO;
using System.Text;
using UnityEditor;
using UnityEngine;
public class ConsoleWriter : TextWriter
{
public override void Write(char value)
{
}
@liortal53
liortal53 / UnityEngineDocsRemover.cs
Created Sep 13, 2015
Workaround for removing UnityEngine.xml that is included for iOS builds
View UnityEngineDocsRemover.cs
using System.IO;
using UnityEditor;
using UnityEditor.Callbacks;
/// <summary>
/// Helper class for removing UnityEngine.xml that is included in iOS builds (bug)
/// </summary>
public static class UnityEngineDocsRemover
{
[PostProcessBuild]
@liortal53
liortal53 / WWWRequest.cs
Last active Jul 9, 2016
Workaround for a Unity bug with yielding a WWW object on iOS with no network connectivity
View WWWRequest.cs
using System.Collections;
using UnityEngine;
/// <summary>
/// Wrapper around Unity's WWW request class.
/// </summary>
public class WWWRequest : IEnumerator
{
/// <summary>
/// The default timeout for requests (in seconds).
@liortal53
liortal53 / RemoveEmptyFolders.cs
Last active Dec 13, 2020
Clean Unity project from empty folders
View RemoveEmptyFolders.cs
using System.IO;
using System.Linq;
using UnityEditor;
using UnityEngine;
public class RemoveEmptyFolders
{
/// <summary>
/// Use this flag to simulate a run, before really deleting any folders.
/// </summary>