LoginSignup
0
3

More than 3 years have passed since last update.

[VRChat向け]R.A.M 2019をUnity2018.4で使う場合の注意点

Last updated at Posted at 2020-05-03

2020/5/7 追記
BugReportしたところ、5/6にFix版をUPしてくださりました~。
現在は修正されていますとのこと。

Unityで「川」の地形を作成したい場合の必須アセット
NatureManufactureさんが提供するツールについてです。
River Auto Material 2019

新しく2019verが発売されており、現在はこちらを使っています。
対応するUnityのVersionが2018.3以上となっており、VRChatの2018.4は対応でした。

しかし、使おうとすると下記のエラーが発生します。

Assets\NatureManufacture Assets\Spline System\Scripts\Editor\RamBackgroundEditor.cs(14,41): error CS0026: Keyword 'this' is not valid in a static property, static method, or static field initializer

これは、2019以下を使った場合のみに起きる不具合っぽく

Assets\NatureManufacture Assets\Spline System\Scripts\Editor\RamBackgroundEditor.cs

上記ファイルにある以下のコードでエラーとなっています。

    static RamBackgroundEditor()
    {
#if UNITY_2019_1_OR_NEWER
        SceneView.duringSceneGui += OnSceneGUI;
#else
        SceneView.onSceneGUIDelegate += this.OnSceneGUI;
#endif
    }

2019.1以下の場合は、Staticの中で「this.OnSceneGUI」とthisが使われております。

コンパイラ エラー CS0026の発生です。

#else
        SceneView.onSceneGUIDelegate += this.OnSceneGUI;

この部分を、下記に変更してあげましょう。
this.をなくすだけですね。

#else
        SceneView.onSceneGUIDelegate += OnSceneGUI;

2019で使っているときは、Error吐かなかったんですが、
define ディレクティブで分けているからか。

この辺はテスト大変そう。

0
3
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
3