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; | |
using System.Collections; | |
[RequireComponent(typeof(AudioSource))] | |
public class Microphone : MonoBehaviour { | |
AudioSource source; | |
void Start () { | |
if(Microphone.devices.Length > 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 System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class DistanceCalculator : MonoBehaviour { | |
public GameObject[] targets; | |
void Update () { | |
foreach(GameObject target in targets) { |
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
//generate an uuid with specify length | |
function uuid(length=26) { | |
let len = Math.min(length, 50)/2; | |
return Math.random().toString(36).substring(2, 2+Math.floor(len)) + | |
Math.random().toString(36).substring(2, 2+Math.ceil(len)); | |
} |
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
//原文及原理请见:http://www.zhangxinxu.com/wordpress/2018/02/js-detect-suppot-font-family/ | |
var isSupportFontFamily=function(f){if(typeof f!="string"){return false}var h="Arial";if(f.toLowerCase()==h.toLowerCase()){return true}var e="a";var d=100;var a=100,i=100;var c=document.createElement("canvas");var b=c.getContext("2d");c.width=a;c.height=i;b.textAlign="center";b.fillStyle="black";b.textBaseline="middle";var g=function(j){b.clearRect(0,0,a,i);b.font=d+"px "+j+", "+h;b.fillText(e,a/2,i/2);var k=b.getImageData(0,0,a,i).data;return[].slice.call(k).filter(function(l){return l!=0})};return g(h).join("")!==g(f).join("")}; |
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"> | |
<!-- https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP --> | |
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self'"> | |
<meta http-equiv="X-Content-Security-Policy" content="default-src 'self'; script-src 'self'"> | |
<title>Hello World!</title> | |
</head> | |
<body> |
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"> | |
<title>Hello World!</title> | |
</head> | |
<body> | |
<h1>iPhone 12 HDR Video Test</h1> | |
<p id="userAgent"></p> |
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
#toolbar { | |
position: absolute; | |
top: -1px; | |
right: 180px; | |
padding: 10px; | |
border: 1px solid #ccc; | |
border-bottom-left-radius: 5px; | |
border-bottom-right-radius: 5px; | |
box-shadow: 0px 0px 10px rgb(0 0 0 / 20%); | |
} |
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
[ | |
{"name": "Afghanistan", "code": "AF"}, | |
{"name": "Åland Islands", "code": "AX"}, | |
{"name": "Albania", "code": "AL"}, | |
{"name": "Algeria", "code": "DZ"}, | |
{"name": "American Samoa", "code": "AS"}, | |
{"name": "AndorrA", "code": "AD"}, | |
{"name": "Angola", "code": "AO"}, | |
{"name": "Anguilla", "code": "AI"}, | |
{"name": "Antarctica", "code": "AQ"}, |