(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
//TODO: determine if C# delegates cause reference counting on target object | |
public delegate void EventDispatcherDelegate( object evtData ); | |
public interface IEventDispatcher | |
{ | |
void addListener (string evtName, EventDispatcherDelegate callback); | |
void dropListener (string evtName, EventDispatcherDelegate callback); | |
void dispatch (string evtName, object evt) ; | |
} |
using System; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public interface ISignal | |
{ | |
void UnsafeSubscribe(Delegate slot, SlotGroup group = null); | |
void UnsafeUnsubscribe(Delegate slot, SlotGroup group = null); | |
} |
using UnityEngine; | |
using System.Collections; | |
public class TimeScaleIndependentParticleSystem : TimeScaleIndependentUpdate | |
{ | |
protected override void Update() | |
{ | |
base.Update(); | |
particleSystem.Simulate(deltaTime, true, false); |
using System; | |
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEditor; | |
using UnityEngine; | |
using Object = UnityEngine.Object; | |
namespace Swing.Editor | |
{ | |
public class EditorCoroutine |
#include "particles.h" | |
#include <assert.h> | |
#include <algorithm> | |
namespace particles | |
{ | |
void ParticleData::generate(size_t maxSize) | |
{ | |
m_count = maxSize; | |
m_countAlive = 0; |
using UnityEngine; | |
using System.Collections; | |
public class SplineSection : MonoBehaviour { | |
public Transform startPoint, startTangent, endPoint, endTangent; | |
public SplineSection prev, next; | |
public Vector3 GetPositionAt(float t) { |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
using UnityEngine; | |
using System.Collections; | |
using System.Collections.Generic; | |
using Extensions; | |
namespace Occlusion | |
{ | |
public class Area : MonoBehaviour | |
{ |
/* BitSet.cs -- A vector of bits. | |
Copyright (C) 1998, 1999, 2000, 2001, 2004, 2005 Free Software Foundation, Inc. | |
This file is part of GNU Classpath. | |
GNU Classpath is free software; you can redistribute it and/or modify | |
it under the terms of the GNU General Public License as published by | |
the Free Software Foundation; either version 2, or (at your option) | |
any later version. | |
public static class GrabScreenSwatch { | |
public static Texture GrabScreenSwatch(Rect rect) { | |
int width = (int)rect.width; | |
int height = (int)rect.height; | |
int x = (int)rect.x; | |
int y = (int)rect.y; | |
Vector2 position = new Vector2(x, y); | |
Color[] pixels = UnityEditorInternal.InternalEditorUtility.ReadScreenPixel(position, width, height); |