This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
If you're looking to store any type of object in a container without using ๐๐๐๐* | |
or creating a new hierarchy, ๐๐๐::๐๐๐ข might be a good choice. | |
It can store any type, but retrieving the stored value requires caution, | |
as you need to know the type to use ๐๐๐::๐๐๐ข_๐๐๐๐ effectively. | |
One useful application for this approach is an object storage class that maintains | |
a list of singletons. This class, ๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐, | |
offers a ๐๐๐ method that either returns an existing object or creates | |
a new one if it doesnโt exist. Internally, | |
๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐ uses a hash map with ๐๐๐::๐๐ข๐๐_๐๐๐๐๐ก as the key and ๐๐๐::๐๐๐ข as the value. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Credit to damien_oconnell from http://forum.unity3d.com/threads/39513-Click-drag-camera-movement | |
// for using the mouse displacement for calculating the amount of camera movement and panning code. | |
using UnityEngine; | |
using System.Collections; | |
public class MoveCamera : MonoBehaviour | |
{ | |
// |