Anchor Multi Resolution

Overview
This is a simple anchor script that is created initially for implementing a GUI (without using OnGUI) in 2D, but can also be used to anchor other GameObjects as well.

It is currently only limited to orthographic camera (although may not be needed).

Feel free to extend it as you see fit.

Usage
1. Tag your main camera as "MainCamera" (Unity has that tag by default).

2. Remember to reset the GameObject transform to (0,0). You can edit it later in both Unity dimension or pixel wise insets.

3. Attach the script to the GameObject and anchors away!

Optional: Read the somewhat short comments in the script to further personalize them for your usage.

Notes: You have to press Play first for the script to be able to find the correct screen resolution.

AnchorMultiResolution.cs

--Hachibei (talk) 16:03, 19 January 2013 (CET)

Changes

19 Jan 2013:

- Fixed NaN errors occurring during Unity initialization

- Minor edit to sections for easier removal

17 Jan 2013: - Implemented a boolean to toggle view on update

- Fixed the public pixel insets so they should be able to display correctly now