As of 1.8, assets are stored by hash, which makes it fiddly to listen to Minecraft's amazing ambient soundtrack outside the game.
This script can be used to copy music files to appopriately-named and organised .ogg
files for easier listening.
--This code can be improved a lot. | |
--Feel free to improve, use or modify in any way although credit would be appreciated. | |
--Global table | |
if BSHADOWS == nil then | |
BSHADOWS = {} | |
--The original drawing layer | |
BSHADOWS.RenderTarget = GetRenderTarget("bshadows_original", ScrW(), ScrH()) |
--This code can be improved a lot. | |
--Feel free to improve, use or modify in any way although credit would be appreciated. | |
if BMASKS == nil then | |
BMASKS = {} --Global table, access the functions here | |
BMASKS.Materials = {} --Cache materials so they dont need to be reloaded | |
BMASKS.Masks = {} --A table of all active mask objects, you should destroy a mask object when done with it | |
--The material used to draw the render targets |
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class FpsController : MonoBehaviour { | |
public float mouseSensitivityX = 1.0f; | |
public float mouseSensitivityY = 1.0f; | |
public float walkSpeed = 10.0f; |
function sec2time(timeInSeconds) { | |
var pad = function(num, size) { return ('000' + num).slice(size * -1); }, | |
time = parseFloat(timeInSeconds).toFixed(3), | |
hours = Math.floor(time / 60 / 60), | |
minutes = Math.floor(time / 60) % 60, | |
seconds = Math.floor(time - minutes * 60), | |
milliseconds = time.slice(-3); | |
return pad(hours, 2) + ':' + pad(minutes, 2) + ':' + pad(seconds, 2) + ',' + pad(milliseconds, 3); | |
} |
As of 1.8, assets are stored by hash, which makes it fiddly to listen to Minecraft's amazing ambient soundtrack outside the game.
This script can be used to copy music files to appopriately-named and organised .ogg
files for easier listening.
assets
directory:/* | |
A full list of simple easing equations inspired by GIST from greweb - https://gist.github.com/gre/1650294 | |
Equations source - http://gsgd.co.uk/sandbox/jquery/easing/ | |
*/ | |
{ | |
linear: function(t) { | |
return t | |
}, | |
inQuad: function(t) { |
Please consider using http://lygia.xyz instead of copy/pasting this functions. It expand suport for voronoi, voronoise, fbm, noise, worley, noise, derivatives and much more, through simple file dependencies. Take a look to https://github.com/patriciogonzalezvivo/lygia/tree/main/generative
float rand(float n){return fract(sin(n) * 43758.5453123);}
float noise(float p){
float fl = floor(p);
float fc = fract(p);
using UnityEngine; | |
using System.Collections; | |
public class CameraShake : MonoBehaviour | |
{ | |
// Transform of the camera to shake. Grabs the gameObject's transform | |
// if null. | |
public Transform camTransform; | |
// How long the object should shake for. |
/* | |
* This work is free. You can redistribute it and/or modify it under the | |
* terms of the Do What The Fuck You Want To Public License, Version 2, | |
* as published by Sam Hocevar. See the COPYING file for more details. | |
*/ | |
/* | |
* Easing Functions - inspired from http://gizma.com/easing/ | |
* only considering the t value for the range [0, 1] => [0, 1] | |
*/ | |
EasingFunctions = { |