Search Unity

Need Help with My First Editor Script

Discussion in 'Scripting' started by Maker16, Aug 24, 2011.

  1. Maker16

    Maker16

    Joined:
    Mar 4, 2009
    Posts:
    779
    I just need a general indication of what classes or functions I need to be using to do this. I want to be able to go into the inspector for a hexmap object, indicate how many hexes per side I want on my hex map, and have a button there I can push to make it create the actual map. A hexmap is a collection of hexagon objects positioned adjacent to each other as they should be.

    I already have the logic and scripting worked out to create the hex map, but, as of right now, it only does it when I play the game. I'm trying to create an editor tool that makes it trivial to generate a new hex map object in the editor to speed up development. As it is, I have to position each individual hexagon manually, and when you have maps that are even 10 x 10, this can get time consuming. Furthermore, I plan to extend the generator to automatically assign terrain values to the hexes based on user defined parameters, but I figure, if I can just get the very basic generation functionality working, I can easily extend it later.
     
  2. juanelo

    juanelo

    Joined:
    Jan 28, 2011
    Posts:
    46
    Not sure if this helps, but it sounds like what you need is to use ScriptableWizard