<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>bluebirdofoz</author_name>
  <author_url>https://blog.hatena.ne.jp/bluebirdofoz/</author_url>
  <blog_title>MRが楽しい</blog_title>
  <blog_url>https://bluebirdofoz.hatenablog.com/</blog_url>
  <categories>
  </categories>
  <description>本日はUnityの小ネタ枠です。 Unityでスクリプトから作成済みのレイヤー一覧を取得する方法についてです。 LayerMask.LayerToName レイヤー番号からレイヤー名を取得します。 レイヤー名の設定がないレイヤー番号を指定すると空文字が返ります。 本関数を使って0番～31番のレイヤーがAdd Layerで設定済みのレイヤーか否かを判定できます。 docs.unity3d.com サンプルスクリプト 現在設定済みの全てのレイヤーを走査してログに出力する以下のサンプルスクリプトを作成しました。 ・LayerCheckTest.cs using System.Collections.…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fbluebirdofoz.hatenablog.com%2Fentry%2F2024%2F07%2F27%2F005304&quot; title=&quot;Unityでスクリプトから作成済みのレイヤー一覧を取得する - MRが楽しい&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url>https://cdn-ak.f.st-hatena.com/images/fotolife/b/bluebirdofoz/20240727/20240727005253.jpg</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2024-07-27 00:53:04</published>
  <title>Unityでスクリプトから作成済みのレイヤー一覧を取得する</title>
  <type>rich</type>
  <url>https://bluebirdofoz.hatenablog.com/entry/2024/07/27/005304</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
