private Texture2D GetSpriteTexture(Sprite sprite)
{
int x = Mathf.FloorToInt(sprite.rect.x);
int y = Mathf.FloorToInt(sprite.rect.y);
int w = Mathf.FloorToInt(sprite.rect.width);
int h = Mathf.FloorToInt(sprite.rect.height);
This file contains hidden or 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
Lazy man's guide: multiple GitHub HTTPS accounts on Windows | |
https://dev.to/configcat/lazy-man-s-guide-multiple-github-https-accounts-on-windows-2mad |
This file contains hidden or 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; | |
using System.Runtime.Serialization.Formatters.Binary; | |
using System.IO; | |
namespace Utils | |
{ | |
//Extension class to provide serialize / deserialize methods to object. | |
//src: http://stackoverflow.com/questions/1446547/how-to-convert-an-object-to-a-byte-array-in-c-sharp | |
//NOTE: You need add [Serializable] attribute in your class to enable serialization |
This file contains hidden or 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"> | |
<meta name="viewport" content="width=device-width,user-scalable=no"> | |
<title>Guidage</title> | |
<style type="text/css"> | |
body { | |
display: flex; | |
min-height: 100%; |
This file contains hidden or 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>Function vs eval pefromance</title> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script> | |
<script src="./suite.js"></script> | |
</head> | |
<body> | |
<h1>Open the console to view the results</h1> |