KITASENJU DESIGN BLOG

memo, html, javascript, unity

Entries from 2024-02-01 to 1 month

PM2でラズパイのコマンドを永続化

以下のようなコマンドで動くnodejsのプログラムがあって、これを永続化させたいということがあった。 sudo npm run example -- examples/hoge.ts' そこで以下のようなhoge.jsを用意した。 const { exec } = require('child_process'); // 実行したいコマンド…

unity+macで書き出したappが動かない

A Mac+Unity-exported app that downloaded from web doesn't work. It is a security problem. You have to do below on Terminal. Unityから書き出したappがネット経由でダウンロードしたappが動かない。 壊れていると言われる。ターミナルで以下を入力。 …

操作後、sliderにフォーカスを渡さないように

I didn't want uGUI to focus a slider after using it on Unity. unityのuguiにて。 private Slider _slider1; _slider1.onValueChanged.AddListener(_onChange); private void _onChange(float value){ EventSystem.current.SetSelectedGameObject(null);/…

scrapboxのシンプルカスタムcss

けっこういい! [** pin & page-list-item] code:style.css /* pinnedのグループを独立させる */ .page-list-item.pin + .page-list-item:not(.pin) { clear: both; } /* pinの高さ */ .page-list-item.pin { height: 60px !important; } /* それ以外 */ .pa…

webglからpngを毎フレームレンダリング

async tick(){ this.renderer.render(this.scene, this.oCamera); if(Params.isRec) Params.download2(); setTimeout(()=>{ this.tick(); },1000/60) } public static dhandle:any; public static async donwloadInit(){ Params.dhandle = await (window as …

typescriptでエラー無視する

// @ts-ignore をかく // @ts-ignore let example = 2; example = "型チェックを無視";

Unityでphysicsをoff

Physics.autoSimulation = false; Physics2D.autoSimulation = false;

unityから書き出したmacのアプリが動かなかった

https://qiita.com/aike@github/items/5df284620059bfc07364 macのappをunityから書き出してwebにファイルをアップ それがローカルファイルを参照するようなものだったとき、動かない! セキュリティの問題で 新規フォルダを作成→appをコピペ→それ以外をコピ…

onguiで背景を設定

[SerializeField] private Texture2D _bg; private void OnGUI(){ if (style == null) { style = new GUIStyle(); style.fontSize = 30; style.normal.textColor = Color.white; style.normal.background = _bg; } GUI.Label( new Rect(0, 700, 200, 50), _i…

unityからdirectoryを作る

public static void MakeNewDir(string newPath){ if ( Directory.Exists( newPath )) { // フォルダが存在する. Debug.Log("既に存在しているのでディレクトリつくらない " + newPath); }else{ Directory.CreateDirectory( newPath ); Debug.Log("ディレク…

"FOOTER"