Skip to content

Instantly share code, notes, and snippets.

View stramit's full-sized avatar

Tim Cooper stramit

View GitHub Profile
using UnityEngine.EventSystems;
namespace UnityEngine.UI
{
[RequireComponent (typeof (Canvas))]
[ExecuteInEditMode]
[AddComponentMenu("Layout/Physical Resolution", 102)]
public class PhysicalResolution : UIBehaviour
{
@stramit
stramit / Image.cs
Created August 25, 2014 23:36
Image
using System;
using System.Collections.Generic;
namespace UnityEngine.UI
{
/// <summary>
/// Image is a textured element in the UI hierarchy.
/// </summary>
[AddComponentMenu("UI/Image", 10)]
@stramit
stramit / Graphic.cs
Created August 25, 2014 23:38
Graphic
using System;
using System.Collections.Generic;
using UnityEngine.Events;
using UnityEngine.EventSystems;
using UnityEngine.UI.CoroutineTween;
namespace UnityEngine.UI
{
/// <summary>
/// Base class for all UI components that should be derived from when creating new Graphic types.
@stramit
stramit / Text.cs
Created September 22, 2014 12:55
Text Element
using System;
using System.Collections.Generic;
using System.Text;
namespace UnityEngine.UI
{
/// <summary>
/// Labels are graphics that display text.
/// </summary>
using UnityEngine.EventSystems;
namespace UnityEngine.UI
{
[RequireComponent (typeof (Canvas))]
[ExecuteInEditMode]
[AddComponentMenu("Layout/Reference Resolution", 101)]
public class ReferenceResolution : UIBehaviour
{
using UnityEngine;
using UnityEditor;
//Put this under a folder called Editor in your project
public class EmptyGOCreator
{
[MenuItem ("GameObject/Create Empty at level %g")]
static void CreateEmptyGOAtLevel ()
{
var go = new GameObject("GameObject");
@stramit
stramit / Shadow.cs
Created September 18, 2014 13:37
Vertex Effect Example
using System.Collections.Generic;
namespace UnityEngine.UI
{
[AddComponentMenu ("UI/Effects/Shadow", 14)]
public class Shadow : BaseVertexEffect
{
[SerializeField]
private Color m_EffectColor = new Color (0f, 0f, 0f, 0.5f);
@stramit
stramit / CoroutineTween.cs
Last active August 16, 2016 23:34
CoroutineTween.cs
/*
* This code is provided as is without warranty, guarantee of function,
* or provided support
*/
using System.Collections;
using UnityEngine.Events;
namespace UnityEngine.UI.CoroutineTween
{
@stramit
stramit / ScrollRect.cs
Created July 28, 2014 20:00
Scroll Rect
using System.Collections.Generic;
using UnityEngine.EventSystems;
namespace UnityEngine.UI
{
[AddComponentMenu ("UI/Scroll Rect", 33)]
[SelectionBase]
[ExecuteInEditMode]
[RequireComponent(typeof(RectTransform))]
using System;
using UnityEngine.Events;
using UnityEngine.EventSystems;
namespace UnityEngine.UI
{
/// <summary>
/// Simple toggle -- something that has an 'on' and 'off' states: checkbox, toggle button, radio button, etc.
/// </summary>
[AddComponentMenu("UI/Toggle", 35)]