Search Unity

Temporary Mesh for use in Custom Inspector

Discussion in 'Scripting' started by BrightBit, Mar 30, 2014.

  1. BrightBit

    BrightBit

    Joined:
    Jan 22, 2013
    Posts:
    265
    A simple tile based terrain editor I am working on needs to be able to highlight selected tiles. To do that I was adding a MeshFilter component and a MeshRenderer component to my parent Terrain GameObject. I've set their HideFlags to HideAndDontSave since I will only need the tile highlights in editor mode. The problem is that by hitting play I am getting the following error message:

    Code (csharp):
    1.  
    2. Component MeshFilter could not be loaded when loading game object. Cleaning up!
    3. Component MeshRenderer could not be loaded when loading game object. Cleaning up!
    4.  
    What does that mean?

    Is there another way to create a mesh that will only be used in editor mode?

    $illustratio.png
     
  2. LightStriker

    LightStriker

    Joined:
    Aug 3, 2013
    Posts:
    2,717