This is a guide for aligning images.
See the full Advanced Markdown doc for more tips and tricks
namespace Helpers | |
{ | |
internal static class SubstringExtensions | |
{ | |
/// <summary> | |
/// Get string value between [first] a and [last] b. | |
/// </summary> | |
public static string Between(this string value, string a, string b) | |
{ | |
int posA = value.IndexOf(a); |
This is a guide for aligning images.
See the full Advanced Markdown doc for more tips and tricks
using UnityEngine; | |
using System.Collections; | |
// based on http://unitytipsandtricks.blogspot.com/2013/05/camera-shake.html | |
public class PerlinShake : MonoBehaviour | |
{ | |
public float duration = 2f; | |
public float speed = 20f; | |
public float magnitude = 2f; | |
public AnimationCurve damper = new AnimationCurve(new Keyframe(0f, 1f), new Keyframe(0.9f, .33f, -2f, -2f), new Keyframe(1f, 0f, -5.65f, -5.65f)); |
public class Perlin { | |
public static double OctavePerlin(double x, double y, double z, int octaves, double persistence) { | |
double total = 0; | |
double frequency = 1; | |
double amplitude = 1; | |
for(int i=0;i<octaves;i++) { | |
total += perlin(x * frequency, y * frequency, z * frequency) * amplitude; | |
amplitude *= persistence; |
using UnityEngine; | |
using System.Collections; | |
// This is basically how the Super Metroid camera worked. Whichever direction you moved, the camera would | |
// move in the same direction a multiple of the player's speed. Once the center of the camera moved a | |
// certain distance from the player, the camera would lock on the player and move the same speed. Change | |
// movement direction, and the camera would once again move more quickly to catch up and place itself | |
// ahead of the player's movement. | |
// Super Metroid also had area limits and locked certain axes based on where you were. For instance, if |
<form action="/"> | |
<legend>A Sample Form Legend</legend> | |
<label for="name">Name: </label> | |
<input type="text" value="Name" name="Name" /> | |
<label for="email">Email: </label> | |
<input type="email" value="Email" name="Email" /> |
// Usage: | |
m_SideBarTexture = CreateTexture (CreateColor ("#30433C")); | |
// The goodness: | |
static Color CreateColor (string hexCode, float alpha = 1.0f) | |
{ | |
if (hexCode.Length == 7 && hexCode[0] == '#') | |
{ |