This file contains 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.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class SnekSolver : MonoBehaviour { | |
[Header("Joints")] | |
public int totalJoints = 10; | |
[Space] | |
public float maxLength = 1; |
This file contains 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.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
// tester part here, scroll for smartTrail class | |
public class testSmartTrail : MonoBehaviour { | |
[Header("Line parameters")] |
This file contains 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.Collections.Generic; | |
using UnityEngine; | |
using UnityEngine.EventSystems; | |
using UnityEngine.UI; | |
[RequireComponent(typeof(ScrollRect))] | |
public class ScrollRectAutoScroll : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler | |
{ | |
public float scrollSpeed = 10f; | |
private bool mouseOver = false; |
This file contains 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 "Toon/Lit Swaying" { | |
Properties { | |
_Color ("Main Color", Color) = (0.5,0.5,0.5,1) | |
_MainTex ("Base (RGB)", 2D) = "white" {} | |
_Ramp ("Toon Ramp (RGB)", 2D) = "gray" {} | |
_Speed ("MoveSpeed", Range(20,50)) = 25 // speed of the swaying | |
_Rigidness("Rigidness", Range(1,50)) = 25 // lower makes it look more "liquid" higher makes it look rigid | |
_SwayMax("Sway Max", Range(0, 0.1)) = .005 // how far the swaying goes | |
_YOffset("Y offset", float) = 0.5// y offset, below this is no animation | |
This file contains 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
IEnumerator slowExplodeCO(SpriteRenderer spriteRendrr, float duration=1, bool reuseSprite=true) { | |
if(spriteRendrr==null) | |
spriteRendrr=GetComponent<SpriteRenderer>(); | |
sprite = spriteRendrr.sprite; | |
width=(int)sprite.textureRect.width; | |
height=(int)sprite.textureRect.height; | |
ox=(int)sprite.textureRect.position.x; |
This file contains 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
// Per pixel bumped refraction. | |
// Uses a normal map to distort the image behind, and | |
// an additional texture to tint the color. | |
Shader "FX/Glass/Stained BumpDistort Orthographic" { | |
Properties { | |
_BumpAmt ("Distortion", range (0,128)) = 10 | |
_MainTex ("Tint Color (RGB)", 2D) = "white" {} | |
_BumpMap ("Normalmap", 2D) = "bump" {} | |
[Toggle(ORTHO)] _ORTHO("Orthographic", Float) = 0 |
This file contains 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; | |
public class Camera2D : MonoBehaviour | |
{ | |
//The background image to use | |
public Transform Area; | |
//Sprite details | |
private Sprite Sprite; | |
private float PixelUnits; |
This file contains 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
/* | |
MIT License | |
Copyright (c) 2016 Jesse Ringrose | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
<style id="jsbin-css"> | |
body { | |
margin: 50px 25px 0 25px; | |
background-color: #ccc; |
This file contains 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 UnityEditor; | |
using UnityEngine; | |
public class RasterizeGradient : EditorWindow { | |
private AnimationCurve curve; | |
private int imageWidth; | |
[MenuItem("Window/Rasterize Gradient")] | |
public static void OpenTPImporter() { |