Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Inspector - enum Dropdown menu variable showing.

Discussion in 'Editor & General Support' started by DatCaptainHorse, Aug 22, 2015.

  1. DatCaptainHorse

    DatCaptainHorse

    Joined:
    Mar 29, 2014
    Posts:
    13
    Please tell me if this is in wrong forum area. And point me to the right.

    When I try to make understandable and clear thread, it usually ends up being all messy.. So hang on.


    Playing with Unity and stuff in it, decided to make spaceship and add turret to it.

    It's about Enum, I have tType (its a shorten of turretType) of Projectile and Beam.

    Now, there are going to be lots of different variables in the Inspector view. I'd like to show variables for the beamy stuff when Beam is selected in enum drop down thingy, and projectile stuff when Projectile is selected.

    I tried looking at Custom Editor, but I have never touched that before so I don't know.
    Also I tried having certain variables in 'function OnValidate ()' and inside there I had 'if tType == Projectile' where the variables were, but I could not use the variables then.

    Thanks in advance.
     
    Last edited: Sep 5, 2015
  2. DatCaptainHorse

    DatCaptainHorse

    Joined:
    Mar 29, 2014
    Posts:
    13
    It's so... Lonely in here.

    Hello? Is anybody there?

    Does anyone hear me?

    Hello?