
Untitled
By: a guest on
Aug 11th, 2012 | syntax:
None | size: 1.39 KB | hits: 8 | expires: Never
using UnityEngine;
using System.Collections;
// TODO: Needs own Camera and GUILayer to ensure the GUI is on screen!
// TODO: Camera depth - must be set, and non-griefable by user. (auto set to highest depth)
// TODO: Probably need a GUILayer to use with GUITextures and Camera
// TODO: Need to place the ad image at bottom of screen, using percentage of screen real estate
// TODO: Just print something upon user clicking icon
// TODO: @velvetycouch the GO needs to be created with instantiate too otherwise it has no transform/position etc
public class ShowGUI : MonoBehaviour {
// For maximum control, the Tap For Tap plugin creates it's own new GameObject
GameObject go;
Texture2D texture;
GUITexture gnarGames;
Camera camera;
// Use this for initialization
void Start () {
// Sets up a GUI
go = new GameObject();
texture = (Texture2D)Resources.Load("gnargames");//"Tap For Tap/Images/gnargames");
gnarGames = new GUITexture();
camera = new Camera();
camera.depth = Camera.main.depth + 1;
if( camera.depth == null )
Debug.Log("scrimshaw");
go.transform.position = Vector3.zero;
go.gameObject.AddComponent(guiTexture.GetType());
//go.gameObject.AddComponent(camera.GetType());
go.guiTexture.texture = texture;
go.gameObject.guiTexture.pixelInset = new Rect(-64, -32, 128, 64);
}
// Update is called once per frame
void Update () {
}
}