0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Unity2021.2.7f1でShaderGraphのCustomFunctionがUndeclared Identifierする場合のメモ

Posted at

はじめに

タイトルのバージョンだと,Unity公式のドキュメントや有志のブログ記事どおりに進めても一行エラーを起こす箇所があるのでその説明.

該当箇所

Unity公式のドキュメントなどのテンプレートはこれ

# define MYFUNCTION_INCLUDED
# ifdef MYFUNCTION_INCLUDED
{
}
# endif

が,https://forum.unity.com/threads/custom-function-undeclared-identifier-help.1157867/
このフォーラムによると2020の時点で,#ifdefがバグで使えないらしく#if defined()を使う必要がある.
ということで治すとこうなる.

# define MYFUNCTION_INCLUDED
# if defined(MYFUNCTION_INCLUDED)
{
}
# endif

追記:ifdefの箇所を修正したことでエラーが消えた後,元に戻したらなんか普通に動いてた わけわかめ

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?