Search Unity

  1. Unity 2019.1 beta is now available.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. We're looking for insight from anyone who has experience with game testing to help us better Unity. Take our survey here. If chosen to participate you'll be entered into a sweepstake to win an Amazon gift card.
    Dismiss Notice
  4. On February 28th the Feedback website will shut down and be redirected to the Unity forums. See the full post for more information.
    Dismiss Notice
  5. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  6. Unity 2018.3 is now released.
    Dismiss Notice
  7. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice

Error when creating custom PaintTextureTool

Discussion in 'World Building' started by Rowlan, Feb 7, 2019.

  1. Rowlan


    Aug 4, 2016
    I'd like to create my own Terrain Tool and combine height modification with texture painting. For learning purposes about how to do that, I tried to get the PaintTextureTool.cs from the UnityCsReference Link to work:

    Problem is that it isn't compilable when I add the file into my project (names of course changed). Errors:

    Code (CSharp):
    1. Assets\Editor\TerrainTools\PaintTextureToolCopy.cs(12,6): error CS0122: 'FilePathAttribute' is inaccessible due to its protection level
    2. Assets\Editor\TerrainTools\PaintTextureToolCopy.cs(33,9): error CS0122: 'TerrainLayerInspector' is inaccessible due to its protection level
    3. Assets\Editor\TerrainTools\PaintTextureToolCopy.cs(78,37): error CS0117: 'Editor' does not contain a definition for 'DrawHeaderGUI'
    4. Assets\Editor\TerrainTools\PaintTextureToolCopy.cs(81,41): error CS0117: 'EditorGUI' does not contain a definition for 'GetInspectorTitleBarObjectFoldoutRenderRect'
    5. Assets\Editor\TerrainTools\PaintTextureToolCopy.cs(83,41): error CS0117: 'EditorGUI' does not contain a definition for 'DoObjectFoldout'
    6. Assets\Editor\TerrainTools\PaintTextureToolCopy.cs(117,42): error CS1061: 'MaterialEditor' does not contain a definition for 'firstInspectedEditor' and no accessible extension method 'firstInspectedEditor' accepting a first argument of type 'MaterialEditor' could be found (are you missing a using directive or an assembly reference?)
    Any idea how to get around that? Using Unity 2018.3.4f1.
  2. Flavelius


    Jul 8, 2012
    wyatttt and Rowlan like this.
  3. wyatttt


    Unity Technologies

    May 9, 2018
    @Rowlan some of those functions are part of the internal Editor API so you won't be able to use them directly in your script
    Rowlan likes this.