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
using UnityEngine; | |
using System.Collections; | |
using System.Collections.Generic; | |
public class GridValue | |
{ | |
// should we ever need it | |
public enum EntityType | |
{ | |
None, |
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
using UnityEngine; | |
using System.Collections; | |
using System.Collections.Generic; | |
public class UpdateGridOnTrigger : MonoBehaviour { | |
MonoBehaviour script; | |
readonly static float TerrainSize = 256f; // set this | |
void Start(){ |
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
using UnityEngine; | |
using System.Collections; | |
using System.Collections.Generic; | |
using System; | |
// could easily be refactored into a static class... | |
public class MoveWhenFar : MonoBehaviour { | |
readonly static float TerrainSize = 256f; // D R Y... refactor centrally... |
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
const float2 r = float2( | |
23.1406926327792690, // e^pi (Gelfond's constant) | |
2.6651441426902251); // 2^sqrt(2) (Gelfond–Schneider constant) | |
return frac( cos( fmod( 12345678., 1e-7 + 256. * dot(p,r) ) ) ); | |
// Random, enjoy |
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
using UnityEngine; | |
using System.Collections; | |
using UnityEngine.UI; | |
public class GenerateTextObjectAndPositionDuringRuntime : MonoBehaviour | |
{ | |
public Canvas CanvasToPopulate; | |
public GameObject TextPrefab; | |
private GameObject instantiatedPrefab; |
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
using UnityEngine; | |
using System.Collections; | |
public static class WorldToCanvasPosition { | |
// Use this for initialization | |
public static Vector2 ConvertWorldToCanvasPosition(RectTransform canvas, Camera camera, Vector3 position) | |
{ | |
Vector2 temp = camera.WorldToViewportPoint(position); | |
temp.x *= canvas.sizeDelta.x; |
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
Shader "UI/TopMostFont" { | |
Properties { | |
_MainTex ("Font Texture", 2D) = "white" {} | |
_Color ("Text Color", Color) = (1,1,1,1) | |
_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 |
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
using UnityEngine; | |
using System.Collections; | |
using UnityEngine.UI; | |
public class GenerateTextObjectAndPositionDuringRuntime_FOR_PREFABS : MonoBehaviour | |
{ | |
public string CanvasToPopulatesTag; | |
public string TextPrefabTag; |
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
using System; | |
using System.Collections; | |
using UnityEngine.UI; | |
using UnityEngine; | |
public static class OverlayReferenceHolders | |
{ | |
public static GameObject OverlayCanvas; | |
public static GameObject TextPrefab; |
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
using UnityEngine; | |
using UnityEditor; | |
using System.Collections; | |
public class ListBundles : MonoBehaviour | |
{ | |
[MenuItem("Assets/AssetBundles/List AssetBundles %#l")] | |
static void List() | |
{ |