土屋つかさの技術ブログは今か無しか

土屋つかさが主にプログラミングについて語るブログです。

カスタムマテリアルエディターまわりのドキュメント誤訳メモ

ShaderGUI.FindProperty

https://docs.unity3d.com/jp/current/ScriptReference/ShaderGUI.FindProperty.html

原文:If true then this method will throw an exception if a property with propertyName was not found.
公式訳:True の場合、このメソッドは例外をスローし、そうでなければ propertyName を持つプロパティーが見つからなかったことを意味します
私訳:Trueの場合、propertyNameに対応するプロパティが発見できなかった場合に、このメソッドは例外を送出します。

 Mandatoryは"強制の"を意味する形容詞で、「そのプロパティが存在することを必須とするか」を設定する真偽値になります。通常、ShaderGUI.FindPropertyでは目的のプロパティが見つからない場合nullが返るのですが、propertyIsMandatoryにtrueが設定されている場合は例外が送出されます。

MaterialEditor.RegisterPropertyChangeUndo

https://docs.unity3d.com/ja/current/ScriptReference/MaterialEditor.RegisterPropertyChangeUndo.html

原文:Call this when you change a material property. It will add an undo for the action.
公式訳:マテリアルプロパティーを変更したときに呼び出し、アクションの取り消しを追加します
私訳:マテリアルプロパティを変更した際にこのメソッドを実行して下さい。このメソッドはその処理のundoを追加します。

 Undo Labelの説明がありませんが、恐らくメニューのEdit>Undoの箇所に表示される文字列のことでしょう。

MaterialEditor.GetTexturePropertyCustomArea

https://docs.unity3d.com/ScriptReference/MaterialEditor.GetTexturePropertyCustomArea.html
原文:Returns the free rect below the label and before the large thumb object field. Is used for e.g. tiling and offset properties.
公式訳:ラベルの下で大きないくつかのオブジェクトフィールドの前にフリーな Rect を返します。タイルやオフセットプロパティーなどに使用されます
土屋訳:ラベルより下、かつ、サムネイル(大)フィールドより手前の利用可能なRectを返します。tiling&offsetプロパティなどに利用します。

MaterialEditor.SetDefaultGUIWidths

https://docs.unity3d.com/2018.1/Documentation/ScriptReference/MaterialEditor.SetDefaultGUIWidths.html
原文:Set EditorGUIUtility.fieldWidth and labelWidth to the default values that PropertiesGUI uses.
公式訳:PropertiesGUI を使用して EditorGUIUtility.fieldWidth と labelWidth をデフォルト値に設定します
土屋訳:PropertiesGUIが参照するEditorGUIUtility.fieldWidthとlabelWidthを初期値に設定します。