Skip to content

Instantly share code, notes, and snippets.

arun02139

Block or report user

Report or block arun02139

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:4e2439241a033c04b709
Shader "Custom/UnlitTransparentReticle"
{
Properties
{
_MainTex ("Base (RGB), Alpha (A)", 2D) = "white" {}
_StencilComp ("Stencil Comparison", Float) = 8
_Stencil ("Stencil ID", Float) = 0
_StencilOp ("Stencil Operation", Float) = 0
_StencilWriteMask ("Stencil Write Mask", Float) = 255
_StencilReadMask ("Stencil Read Mask", Float) = 255
View TouchFilter.cs
using UnityEngine;
using TouchScript;
using UnityEngine.EventSystems;
using System.Reflection;
public class TouchFilter : MonoBehaviour
{
void OnEnable()
{
TouchManager.Instance.TouchesBegan += touchEventOccured;
View gist:30df7a9eb2ad0c96ec38
public static GameObject FindRecursive(this GameObject o, string target_name)
{
if(o.name == target_name)
return o;
int numChildren = o.transform.childCount;
for (int i = 0; i < numChildren; ++i)
{
GameObject tRet = o.transform.GetChild(i).gameObject.FindRecursive(target_name);
if(tRet != null)
View gist:5e27f8bcd21650a5dbdd
using UnityEngine;
using System.Collections.Generic;
using System.Text;
using NUnit.Framework;
using System;
public static class PrettyPrintExtensions
{
public static string PrettyPrint(this Mesh m)
{
View gist:ab5fea17fe8b10d7b816
using UnityEngine;
// LINK: http://docs.unity3d.com/Manual/SL-SubshaderTags.html
public enum RenderOrderType { None = 0, Background = 1000, Geometry = 2000, PhoenixGround = 2010, PhoenixGroundShadow = 2020,
PhoenixEnvironProp = 2030, AlphaTest = 2450, Transparent = 3000, Overlay = 4000 }
public class RenderOrder : MonoBehaviour
{
public int Order;
Material material;
View Reticle.cs
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.EventSystems;
using System.Collections.Generic;
using NUnit.Framework;
using Object = UnityEngine.Object;
// LINK: Original code for solution: http://goo.gl/cAlqjS (see Gibbonator's solution)
// LINK: Extend editor so we can set sorting layers on andything with a mesh renderer: http://goo.gl/VehK0j
public enum ReticleTargetState { None = 0, UGUIFlat, UGUICurved, World }
View gist:d34e70e3b4ac9441a8af
using UnityEngine;
// interface and base state class
//////////////////
public interface IBaseState
{
void Enter(object o);
void Exit(object o);
}
View TurnListTap.cs
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.EventSystems;
using System.Collections;
using NUnit.Framework;
public class TurnListTap : MonoBehaviour, IPointerClickHandler
{
public Transform Target;
bool open;
View UnitSight.cs
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class UnitSight : MonoBehaviour
{
public Collider[] overlapCollider;
List<Unit> _opponentObservers;
BoxCollider _bc;
View Eye.cs
using UnityEngine;
#if UNITY_EDITOR
using UnityEditor;
#endif
using UnityEngine.Assertions;
using System.Collections.Generic;
public class Eye : MonoBehaviour
{
// public for debugging
You can’t perform that action at this time.