Skip to content

Instantly share code, notes, and snippets.

public struct Buffer : IBufferElementData
{
int x;
}
public struct Data : IComponentData
{
int y;
}
public class PositionComponent : IComponent
{
int x;
int y;
}
I change to:
public class PositionComponent : IComponent
{
using System;
using UnityEngine;
// Wait for a simple boolean predicate to be true. Example:
//
// private IEnumerator HandleDeath() {
// yield return new WaitWhile(() => hitPoints != 0);
// Instantiate(SuperCoolDeathFXPrefab);
// }
//
public class IsOverlappingBehavior : MonoBehavior
{
public CapsuleCollider capsule;
public bool IsOverlapping { get; private set; }
private void Update()
{
IsOverlapping = false;
public class IsOverlappingBehavior : MonoBehavior
{
public CapsuleCollider capsule;
public bool IsOverlapping { get; private set; }
private void Update()
{
IsOverlapping = false;
public static class PhysicsExtensions
{
public static void ToWorldSpaceCapsule(
this CapsuleCollider capsule,
out Vector3 point0, out Vector3 point1, out float radius);
public static void ToWorldSpaceBox(
this BoxCollider box,
out Vector3 center, out Vector3 halfExtents, out Quaternion orientation);
using UnityEngine;
public class Comments : MonoBehaviour
{
[Multiline]
public string text;
}
Windows Registry Editor Version 5.00
; Add run as administrator to the menu for autohotkey scripts
; howtogeek.com
[HKEY_CLASSES_ROOT\AutoHotkeyScript\Shell\runas\Command]
@="\"C:\\Program Files\\AutoHotkey\\AutoHotkey.exe\" \"%1\" %*"
"IsolatedCommand"="\"C:\\Program Files\\AutoHotkey\\AutoHotkey.exe\" \"%1\" %*"
@justonia
justonia / State.cs
Created November 17, 2016 19:23
State utility
using UnityEngine;
using System;
/// <summary>
/// The State class is a specialized StateMachineBehaviour that provides an event interface for
/// the messages that Unity calls. Perhaps more importantly, States communicate with the next state
/// (when transitioning into something else) or the previous state (when transitioning from
/// something else). This allows the end-programmer to utilize transition times without losing the
/// reliability of events that can signal changes in control contexts (otherwise there are overlaps
/// when 2 control contexts are simultaneously valid).
type MockRoundTripper struct {
Code int
Body string
Err error
Called int
}
func (t *MockRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) {
t.Called += 1