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

Good Unity Scripting Habit

Discussion in 'Scripting' started by yanuaris, Feb 27, 2016.

  1. yanuaris

    yanuaris

    Joined:
    Oct 16, 2015
    Posts:
    61
    Code management? Scripting habit? Techniques?

    We just scripted a bunch of functions, but when something decidedly changes name...
    like using Main camera into splitting it to 2-3 camera say, camera1, camera2, spectatorcam, and so on...
    we must change almost everything using the find-next-replace.
    Those are one of the simpler case but i worry if we have to tackle more further in the future?

    Is there a habit to document troubleshooting? Or perhaps something practical to ensure our code mobility and flexibility?
    We're a team of two and we rely on concept art to guide our design mostly. :)
     
  2. aer0ace

    aer0ace

    Joined:
    May 11, 2012
    Posts:
    1,511
    Sounds like it's time for you to learn about refactoring.
     
    Kiwasi likes this.
  3. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    You want to avoid using strings if at all possible. This makes refractor img much easier.
     
    yanuaris likes this.
  4. yanuaris

    yanuaris

    Joined:
    Oct 16, 2015
    Posts:
    61
    Well now this is complicated...

    I haven't even done my homework on...Inheritance, polymorphism etc