Skip to content

Instantly share code, notes, and snippets.

const vfmath : any = {
clamp(value : number, min : number, max : number) : number
{
let clamped : number = value
if (value > max) clamped = max
else if (value < min) clamped = min
return clamped
}
}
const dclutils : any = {
getEntityWithName(name : string) : Entity
{
for (let entityKey in engine.entities)
{
let entity = <Entity>engine.entities[entityKey]
if (entity.name == name)
return entity
}
@Vonflaken
Vonflaken / VirtualJoystick.cs
Last active June 1, 2021 02:36
Virtual joystick component for Unity mobile projects.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
#if UNITY_EDITOR && !UNITY_CLOUD_BUILD
using UnityEditor;
#endif

Keybase proof

I hereby claim:

  • I am vonflaken on github.
  • I am vonflaken (https://keybase.io/vonflaken) on keybase.
  • I have a public key whose fingerprint is AD95 9C10 C1D9 BB59 4908 D0F2 967F 1782 FC9A F5BA

To claim this, I am signing this object: