First things first !
sudo apt update
sudo apt upgrade
sudo apt-get install build-essential git
extends KinematicBody2D | |
export var move_speed = 200.0 | |
var velocity := Vector2.ZERO | |
export var jump_height : float | |
export var jump_time_to_peak : float | |
export var jump_time_to_descent : float |
fun loadResource(resource: String): String = | |
try { | |
object {}.javaClass.getResource(resource) | |
.readText(Charsets.UTF_8) | |
} catch (all: Exception) { | |
throw RuntimeException("Failed to load resource=$resource!", all) | |
} |
// Unity C# Cheat Sheet | |
// I made these examples for students with prior exerience working with C# and Unity. | |
// Too much? Try Unity's very good tutorials to get up to speed: https://unity3d.com/learn/tutorials/topics/scripting |
// The MIT License (MIT) | |
// Copyright (c) 2016 David Evans @phosphoer | |
// 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 furnished to do so, subject to the following conditions: | |
// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | |
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR |
using UnityEngine; | |
//! Script that shakes the camera | |
public class CameraShake : MonoBehaviour | |
{ | |
//! The amplitude/strength of the shake. | |
//! Higher values shake the camera harder. | |
public float shakeAmplitude = 0.7f; | |
//! Dampen is how fast our shake stops. Default is 1. | |
public float dampenFactor = 1.0f; |
Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...
// see: https://github.com/chadoe/docker-cleanup-volumes
$ docker volume rm $(docker volume ls -qf dangling=true)
$ docker volume ls -qf dangling=true | xargs -r docker volume rm
require 'benchmark/ips' | |
require 'shallow_attributes' | |
require 'virtus' | |
hash = { | |
addresses: [ | |
{ | |
street: 'Street 1/2', | |
city: { | |
name: 'NYC' |