2023-10-01から1ヶ月間の記事一覧
はじめに Publicな変数を編集できないようにするReadOnlyなCustom Attributeを作成します スクリプト using UnityEngine; using UnityEditor; public class ReadOnlyAttribute : PropertyAttribute { } [CustomPropertyDrawer(typeof(ReadOnlyAttribute))] p…
はじめに 今回はShaderGraphでグローバル変数を使用する方法を紹介していきます。 環境はUnity 2022.3です Universal Render Pipeline を使用しています。 やり方 スクリプト側でグローバル変数を設定します using System.Collections; using System.Collect…
はじめに 今回は指定しパス内にあるテクスチャのパスをすべて取得する方法を紹介します 環境は Unity 2021.3.25f1です コード Directory.GetFilesでパス内にあるファイルを取得できるのでそれを活用します using System.Collections; using System.Collectio…
はじめに スクリプトの値をVFXGraph内で使用する方法を紹介します 環境は Unity 2022.3.1です コード custom spawner block内にあるVFXSpawnerStateのvfxEventAttributeでSet○○を呼ぶことでCustoumAttributeの値をセットすることができます パラメーター名は…