Programming」カテゴリーアーカイブ

プログラミング全般に関するカテゴリーです。

Unityでasync/awaitを使う際に参考になるかもしれないブックマーク

Unityでasync/awaitを使いたいと思って以下のサイトで勉強してみました。(順不同)

How to use Async-Await instead of coroutines in Unity3d 2017 | Steve Vermeulen
http://www.stevevermeulen.com/index.php/2017/09/using-async-await-in-unity3d-2017/

Unity async/awaitで非同期を書く
https://qiita.com/unity_ganbaru/items/b0d837ef1baea5b8bd21

【Unity】Unity 2017 でコルーチンの代わりに async / await を使用する – コガネブログ
http://baba-s.hatenablog.com/entry/2018/05/07/090000

Unityで使える非同期処理アセットとかクラスとか | KDL Tech Blog
https://kobedigitallabo.github.io/2016/09/18/unity-async-assets/

Asynchronous programming | Microsoft Docs
https://docs.microsoft.com/en-us/dotnet/csharp/async

Task Class (System.Threading.Tasks)
https://msdn.microsoft.com/en-us/library/system.threading.tasks.task(v=vs.110).aspx

async/await関係でいろいろ試していると

.... can only be called from the main thread

のようなエラーが発生することがあります。Unityで使う場合は、その辺りに気を付けてください。

What does this error mean? – Unity Forum
https://forum.unity.com/threads/what-does-this-error-mean.338592/

ImageMagickのconvertを使ってfaviconを作成するコマンド

ImageMagickのconvertを使ってfaviconを作成したい場合は次のようなコマンドを実行すると良いそうです。

$ convert source.png -define icon:auto-resize favicon.ico

16×16、24×24、32×32、40×40、48×48、64×64、96×96、128×128、192×192、256×256のマルチアイコンとなるようです。含めるサイズを指定したい場合は

$ convert source.png -define icon:auto-resize=64,48,32,16 favicon.ico

のような感じで実行します。

HTMLのヘッダーへの書き方

favicon.icoの場合は指定する必要はありませんが、ファイル名やパスを変更したい場合はHTMLのヘッダーに

<link rel="shortcut icon" href="/path/to/icon.ico">

のような記述を追加すると良いようです。

リンク

[SOLVED] PNG to ICO while preserving transparency – ImageMagick
http://www.imagemagick.org/discourse-server/viewtopic.php?t=26252

html – Favicon: .ico or .png / correct tags? – Stack Overflow
https://stackoverflow.com/questions/6121725/favicon-ico-or-png-correct-tags

ブラウン管風のシェーダー

ブラウン管風のシェーダーを試してみました。

crt

ノイズ版

crt-noise

使いどころは少し難しそうですが、良い雰囲気のシェーダーと思います。

※ノイズ版はUniRXを使わない形に改変したものを使っています。

リンク

[Unity3D]ブラウン管風シェーダーを作った | notargs.com
http://wordpress.notargs.com/blog/blog/2016/01/09/unity3d%e3%83%96%e3%83%a9%e3%82%a6%e3%83%b3%e7%ae%a1%e9%a2%a8%e3%82%b7%e3%82%a7%e3%83%bc%e3%83%80%e3%83%bc%e3%82%92%e4%bd%9c%e3%81%a3%e3%81%9f/