Skip to content

Instantly share code, notes, and snippets.

View reidscarboro's full-sized avatar

Reid Scarboro reidscarboro

View GitHub Profile
using System.Collections.Generic;
using System.IO;
using ProtoTurtle.BitmapDrawing;
using TMPro;
using UnityEngine;
public class ImageLoader : MonoBehaviour
{
public class NewImageEventArgs { public Texture2D Tex2D; public string FilePath; public bool InitialLoad; };
public delegate void NewImageEventHandler(NewImageEventArgs onNewImageEventArgs);
public class TypewriterEffect : MonoBehaviour
{
public TextMeshProUGUI textMesh;
public float typeSpeed = 0.025f;
public Action OnTypewriterCompleted;
private int currentCursorLocation = 0;
public void SetText(string text)
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class TetherExample : MonoBehaviour
{
public Transform anchor;
public Transform player;
public LineRenderer lineRenderer;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.EventSystems;
using DG.Tweening;
public class ButtonEnlarger : MonoBehaviour {
private Button button;
@reidscarboro
reidscarboro / LoadingDots.cs
Created May 10, 2017 13:29
Bouncing loading dots in Unity using DoTween
using System.Collections.Generic;
using UnityEngine;
using DG.Tweening;
public class LoadingDots : MonoBehaviour {
//the total time of the animation
public float repeatTime = 1;
//the time for a dot to bounce up and come back down
int[,] level = new int[200,100]
caveNoiseScalar = 9;
levelRatio = (float) level.GetLength(0) / level.GetLength(1);
RidgedMultifractal mountainTerrain = new RidgedMultifractal();
Noise2D heightMapBuilder = new Noise2D(level.GetLength(0), level.GetLength(1), mountainTerrain);
Vector2Int startPoint = new Vector2Int(Random.Range(0, 8192), Random.Range(0, 8192));
heightMapBuilder.GeneratePlanar(startPoint.x + 0, startPoint.x + caveNoiseScalar * levelRatio, startPoint.y + 0, startPoint.y + caveNoiseScalar);
float[,] heightMap = heightMapBuilder.GetNormalizedData();