Skip to content

Instantly share code, notes, and snippets.

@Arakade
Arakade / UltimateGameTools-Fracturing-ResetWithTimeout.patch
Last active January 1, 2016 00:09
A patch for Ultimate Game Tools' "Fracturing" Unity3D plugin that adds ability to call FracturedObject.ResetChunks() while still using lifetime timers (DieTimer). UGT: http://www.ultimategametools.com/products/fracturing/ Proposed: http://forum.unity3d.com/threads/184170-Ultimate-Fracturing-amp-Destruction-editor-extension-for-Unity-3D?p=1460344…
diff -ru C:\Users\User\Dev\Unity3D\FracturingNoChanges\Assets\Ultimate Game Tools\Fracturing\Editor\FracturedObjectEditor.cs C:\Users\User\Dev\Unity3D\SnowFallFracturedExperiment\Assets\Ultimate Game Tools\Fracturing\Editor\FracturedObjectEditor.cs
--- C:\Users\User\Dev\Unity3D\FracturingNoChanges\Assets\Ultimate Game Tools\Fracturing\Editor\FracturedObjectEditor.cs Tue Dec 10 20:01:47 2013
+++ C:\Users\User\Dev\Unity3D\SnowFallFracturedExperiment\Assets\Ultimate Game Tools\Fracturing\Editor\FracturedObjectEditor.cs Sat Dec 21 18:24:45 2013
@@ -56,6 +56,7 @@
SerializedProperty PropEventDetachedMinLifeTime;
SerializedProperty PropEventDetachedMaxLifeTime;
SerializedProperty PropEventDetachedOffscreenLifeTime;
+ SerializedProperty PropEventDetachedDestroyRatherThanInactivate;
SerializedProperty PropEventDetachedMinMass;
SerializedProperty PropEventDetachedMinVelocity;
@Arakade
Arakade / MasterAudio.cs.patch
Created January 24, 2014 23:24
Patch for Unity3D MasterAudio v3.3.6 producing all sound variations when PlaySound*AndForget() methods used (more makePlaySoundResult use needed). Diff looks much larger than it actually is due to added indentation needed.
diff --git "a/C:\\Users\\User\\AppData\\Local\\Temp\\TortoiseGit\\MasEC0A.tmp\\MasterAudio-b3070d8-left.cs" "b/C:\\Users\\User\\Dev\\Unity3D\\MusicExperiments\\Assets\\DarkTonic\\MasterAudio\\Scripts\\Singleton\\MasterAudio.cs"
index 4d6ccf1..c9b20e9 100644
--- "a/C:\\Users\\User\\AppData\\Local\\Temp\\TortoiseGit\\MasEC0A.tmp\\MasterAudio-b3070d8-left.cs"
+++ "b/C:\\Users\\User\\Dev\\Unity3D\\MusicExperiments\\Assets\\DarkTonic\\MasterAudio\\Scripts\\Singleton\\MasterAudio.cs"
@@ -1092,62 +1092,67 @@ public class MasterAudio : MonoBehaviour {
do {
playedState = PlaySoundIfAvailable(randomSource, sourcePosition, volumePercentage, pitch, _group, sourceTrans, attachToSource, delaySoundTime, useVector3, makePlaySoundResult);
-
- if (playedState != null && (playedState.SoundPlayed || playedState.SoundScheduled)) {
@Arakade
Arakade / build.gradle
Last active January 16, 2021 19:01 — forked from trashhalo/build.gradle
Updated 2014/07/05 for newer repositories syntax and missing Xalan dependency (needed on Windows)
import com.petebevin.markdown.MarkdownProcessor
import org.xhtmlrenderer.pdf.ITextRenderer
import org.ccil.cowan.tagsoup.Parser
import org.apache.xalan.xsltc.trax.SAX2DOM
import org.xml.sax.InputSource
buildscript{
repositories {
mavenCentral() // i.e. http://repo1.maven.org/maven2
maven { url "https://oss.sonatype.org/content/groups/scala-tools" }
@Arakade
Arakade / AssertionComponentEditor.cs.patch
Created July 13, 2014 14:07
Remove type.IsSerializable test which blocks Comparer's Vector3 members showing in AssertionComponent Editor.
.../UnityTestTools/Assertions/Editor/AssertionComponentEditor.cs | 3 ---
1 file changed, 3 deletions(-)
diff --git a/ProjectName/Assets/UnityTestTools/Assertions/Editor/AssertionComponentEditor.cs b/ProjectName/Assets/UnityTestTools/Assertions/Editor/AssertionComponentEditor.cs
index c5d19a0..90411fd 100644
--- a/ProjectName/Assets/UnityTestTools/Assertions/Editor/AssertionComponentEditor.cs
+++ b/ProjectName/Assets/UnityTestTools/Assertions/Editor/AssertionComponentEditor.cs
@@ -201,9 +201,6 @@ namespace UnityTest
{
foreach (var prop in script.Action.GetType ().GetFields (BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly))
@Arakade
Arakade / AssertionComponentEditor.cs.patch
Created July 13, 2014 14:17
AssertionComponentEditor should includeChildren so Comparer/ActionBase subclasses can include Arrays, etc.
.../UnityTestTools/Assertions/Editor/AssertionComponentEditor.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ProjectName/Assets/UnityTestTools/Assertions/Editor/AssertionComponentEditor.cs b/ProjectName/Assets/UnityTestTools/Assertions/Editor/AssertionComponentEditor.cs
index 1860f7b..c5d19a0 100644
--- a/ProjectName/Assets/UnityTestTools/Assertions/Editor/AssertionComponentEditor.cs
+++ b/ProjectName/Assets/UnityTestTools/Assertions/Editor/AssertionComponentEditor.cs
@@ -208,7 +208,7 @@ namespace UnityTest
var sp = so.FindProperty(prop.Name);
if (sp != null)
@Arakade
Arakade / gist:9dd844c2f9c10e97e3d0
Created January 3, 2015 16:54
Call from OnDrawGizmos() to draw text at Unity3D glocal position in Editor
static void drawString(string text, Vector3 worldPos, Color? colour = null) {
UnityEditor.Handles.BeginGUI();
if (colour.HasValue) GUI.color = colour.Value;
var view = UnityEditor.SceneView.currentDrawingSceneView;
Vector3 screenPos = view.camera.WorldToScreenPoint(worldPos);
Vector2 size = GUI.skin.label.CalcSize(new GUIContent(text));
GUI.Label(new Rect(screenPos.x - (size.x / 2), -screenPos.y + view.position.height + 4, size.x, size.y), text);
UnityEditor.Handles.EndGUI();
}
@Arakade
Arakade / AstarPathEditor.cs.all-assemblies-part-2.patch
Created February 15, 2016 09:35
Part 2 of a patch for A* Project's AstarPathEditor that fixes sections guarded by #define ASTARDEBUG
diff --git "a/C:\\Users\\User\\AppData\\Local\\Temp\\TortoiseGit\\Ast5870.tmp\\AstarPathEditor-25a36d5-left.cs" "b/D:\\Users\\User\\Dev\\Unity3D\\AIExperiments\\Assets\\AstarPathfindingProject\\Editor\\AstarPathEditor.cs"
index 2d23473..2e27f4b 100644
--- "a/C:\\Users\\User\\AppData\\Local\\Temp\\TortoiseGit\\Ast5870.tmp\\AstarPathEditor-25a36d5-left.cs"
+++ "b/D:\\Users\\User\\Dev\\Unity3D\\AIExperiments\\Assets\\AstarPathfindingProject\\Editor\\AstarPathEditor.cs"
@@ -1,3 +1,5 @@
+#define ASTARDEBUG
+
using UnityEngine;
using UnityEditor;
using System.Collections.Generic;
@Arakade
Arakade / GridGeneratorEditor.cs.patch
Created February 15, 2016 23:21
A* Project patch to enable ASTARDEBUG shift-mouse-over displaying path information
diff --git "a/C:\\Users\\User\\AppData\\Local\\Temp\\TortoiseGit\\Gri8182.tmp\\GridGeneratorEditor-c900cb4-left.cs" "b/C:\\Users\\User\\AppData\\Local\\Temp\\TortoiseGit\\Gri8162.tmp\\GridGeneratorEditor-bd6560d-right.cs"
index b636bd5..1facb21 100644
--- "a/C:\\Users\\User\\AppData\\Local\\Temp\\TortoiseGit\\Gri8182.tmp\\GridGeneratorEditor-c900cb4-left.cs"
+++ "b/C:\\Users\\User\\AppData\\Local\\Temp\\TortoiseGit\\Gri8162.tmp\\GridGeneratorEditor-bd6560d-right.cs"
@@ -1,3 +1,5 @@
+#define ASTARDEBUG
+
using UnityEngine;
using UnityEditor;
using Pathfinding.Serialization.JsonFx;
@Arakade
Arakade / Base.cs.patch
Created February 16, 2016 10:57
A* Project better colours for tag visualization
diff --git "a/C:\\Users\\User\\AppData\\Local\\Temp\\TortoiseGit\\Bas7CB4.tmp\\Base-25a36d5-left.cs" "b/D:\\Users\\User\\Dev\\Unity3D\\AIExperiments\\Assets\\AstarPathfindingProject\\Generators\\Base.cs"
index c530058..a8802b7 100644
--- "a/C:\\Users\\User\\AppData\\Local\\Temp\\TortoiseGit\\Bas7CB4.tmp\\Base-25a36d5-left.cs"
+++ "b/D:\\Users\\User\\Dev\\Unity3D\\AIExperiments\\Assets\\AstarPathfindingProject\\Generators\\Base.cs"
@@ -304,7 +304,7 @@ namespace Pathfinding {
c = Color.Lerp (AstarColor.ConnectionLowLerp,AstarColor.ConnectionHighLerp, ((float)node.Penalty-AstarPath.active.debugFloor) / (AstarPath.active.debugRoof-AstarPath.active.debugFloor));
break;
case GraphDebugMode.Tags:
- c = AstarMath.IntToColor ((int)node.Tag,0.5F);
+ c = AstarColor.GetAreaColor(node.Tag);
@Arakade
Arakade / unity-pkg-extract.sh
Created April 29, 2016 19:39
Extract unitypackage contents from extracted directory into more normal form.
#!/bin/bash
# Extract unitypackage contents from extracted directory into more normal form.
# Rupert Key, 2014/09/15-ish
# TODO: Make it extract from the .unitypackage (tar.gz) so don't need initial extract step.
# RK: On updating, don't forget to update the public version!
# Public: If you want, please ping me with any changes / requests.
if [ $# -ne 2 -o "$1" == "-h" ] ; then