Skip to content

Instantly share code, notes, and snippets.

@Tak
Tak / meh.cs
Created December 14, 2018 08:56
class MyEditor
{
int sliderValue = 0;
int sliderMin = 0;
int sliderMax = 15;
void OnInspectorGUI()
{
sliderValue = EditorGUILayout.IntSlider(sliderValue, sliderMin, sliderMax);
}
In Box2D kinematic bodies only collide with other kinematic bodies therefore the second static body doesn't create a contact.
When you change the first body to be dynamic (un-check the IsKinematic property) then it's a dynamic body. Dynamic bodies do collide with static bodies.
Kinematic can collide with Kinematic
Dynamic can collide with Static & Dynamic
Static can collide with Dynamic
Box2D imposes this and not Unity.
#! /bin/bash
# streaming on Ubuntu via ffmpeg.
# see http://ubuntuguide.org/wiki/Screencasts for full documentation
# see http://www.thegameengine.org/miscellaneous/streaming-twitch-tv-ubuntu/
# for instructions on how to use this gist
# input resolution, currently fullscreen.
# you can set it manually in the format "WIDTHxHEIGHT" instead.
INRES=$(xwininfo -root | awk '/geometry/ {print $2}'i)
$ ./StrikeSuitZero
Running Tasks:
22
PRIO NAME STATUS
1) 205: MemoryManager - [Idle]
2) 204: ValkyrieEarlyLoad - [Idle]
3) 202: Filesystem - [Idle]
4) 201: cAsyncLoaderManager - [Idle]
5) 200: RendererBase - [Idle]
6) 160: RenderStateManager - [Idle]
using UnityEngine;
using System.Reflection;
public class ReflectionTest: MonoBehaviour {
// Use this for initialization
void Start () {
Something = 3.1415926f;
}
delegate int AnyFunctionThatTakesTwoFloatsAndReturnsAnInt (float a, float z);
AnyFunctionThatTakesTwoFloatsAndReturnsAnInt myFunction;
// myFunction is null
myFunction (1.1, 2.1); // => NullReferenceException
int AddAndTruncate (float first, float second){ return (int)(first + second); }
myFunction = AddAndTruncate;
levi@levi-XPS-8300:/tmp$ hg init blah
levi@levi-XPS-8300:/tmp$ cd blah
levi@levi-XPS-8300:/tmp/blah$ echo "a" > a
levi@levi-XPS-8300:/tmp/blah$ hg add a
levi@levi-XPS-8300:/tmp/blah$ hg commit -ma
levi@levi-XPS-8300:/tmp/blah$ echo "b" > a
levi@levi-XPS-8300:/tmp/blah$ hg commit -mb
levi@levi-XPS-8300:/tmp/blah$ hg strip --keep .
saved backup bundle to /tmp/blah/.hg/strip-backup/c5d889c88f42-backup.hg
levi@levi-XPS-8300:/tmp/blah$ hg diff
diff --git a/libgc/allchblk.c b/libgc/allchblk.c
index 1a1efc6..8f9b895 100644
--- a/libgc/allchblk.c
+++ b/libgc/allchblk.c
@@ -579,8 +579,8 @@ int n;
register hdr * hhdr; /* Header corr. to hbp */
register struct hblk *thishbp;
register hdr * thishdr; /* Header corr. to hbp */
- signed_word size_needed; /* number of bytes in requested objects */
- signed_word size_avail; /* bytes available in this block */
Linux:
linux-vdso.so.1 => (0x00007fff1ffff000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f68b8647000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f68b7d0e000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f68b794f000)
/lib64/ld-linux-x86-64.so.2 (0x00007f68b9359000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f68b8429000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f68b8221000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f68b7f25000)
import UnityEngine
class Notebook (MonoBehaviour):
selectedTab = 0
tabs = ("First", "Second");
panels = (DrawFirst, DrawSecond)
def OnGUI ():
selectedTab = GUILayout.Toolbar (selectedTab, tabs)
panels[selectedTab]()