Skip to content

Instantly share code, notes, and snippets.

@Domiii
Domiii / SceneNavigator2D.cs
Last active September 29, 2019 02:41
[Unity v5.3] Unity component that allows panning and zooming orthographic camera with standard input, also clamps camera to given container (bounds of a given Sprite)
/**
* 2D camera panning and scrolling. Always clamped to given container.
*/
using UnityEngine;
using System.Collections;
public class SceneNavigator2D : MonoBehaviour {
public Camera Camera;
@Domiii
Domiii / WallSpawner.cs
Last active July 9, 2016 14:30
[Unity v5.3] Create brick wall
/**
* Spawns a wall along the X and Y axes of the WallSpawner, using cubes of given size and materials
*/
using UnityEngine;
using System.Collections;
public class WallSpawner : MonoBehaviour {
public int Nx = 10;
public int Ny = 10;
@Domiii
Domiii / Elevator.cs
Last active October 7, 2021 17:22
[Unity v5.3] Simple elevator
/**
* A simple elevator script. Can be attached to any object to make it move in the given direction.
* Requires a button that calls CallElevator().
*/
using UnityEngine;
using System.Collections;
public class Elevator : MonoBehaviour {
/// <summary>