Search Unity

Creating a test environment for a particular script

Discussion in '2D' started by LankyJon, Mar 24, 2018.

  1. LankyJon

    LankyJon

    Joined:
    Mar 18, 2018
    Posts:
    13
    Hello all. I am currently working on Procedural world generation, and have gotten it working such that I can use unity components to drag sliders around and test out how the new values will affect the world generation. However, as I am using several noise components to generate terrain maps for different features, I would like to be able to easily test one specific script at a time and see what it generates.

    One way of doing this would be to comment out parts of the code I don't want to run, but that's obviously a huge pain, and leads to potential issues with trying not to screw up my code.

    Another would be to create an entirely new project, but this would mean I would have to copy over the values from one project to another every time I wanted to test the components together.

    Is there any way to simply create a new scene and only run that one on play? Or something similar? Thanks.
     
  2. EdKirby

    EdKirby

    Joined:
    Nov 15, 2013
    Posts:
    43
    Hey Jon, I may be missing something here, or even a whole lot, but couldn't you just create a new scene and attach the script you want to test to main camera and when you hit play it would run?
     
  3. LankyJon

    LankyJon

    Joined:
    Mar 18, 2018
    Posts:
    13
    Nope, that would work just fine! (Other than my massive memory issues. Have to figure out why it's taking me so long to generate maps.) I really am new to Unity, and programming in general. Thanks a ton!
     
  4. EdKirby

    EdKirby

    Joined:
    Nov 15, 2013
    Posts:
    43
    You're welcome! I'm glad I could help.