Search Unity

  1. Unity 2019.1 is now released.
    Dismiss Notice

Error when creating custom PaintTextureTool

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

  1. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    730
    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

    Flavelius

    Joined:
    Jul 8, 2012
    Posts:
    579
    wyatttt and Rowlan like this.
  3. wyatttt

    wyatttt

    Unity Technologies

    Joined:
    May 9, 2018
    Posts:
    173
    @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.