Search Unity

is Drag-drop prefabs/objets a good practice?

Discussion in 'Scripting' started by Yamiks, Apr 1, 2015.

  1. Yamiks

    Yamiks

    Joined:
    Oct 21, 2014
    Posts:
    5
    So as i program i tend to do a lot of hard-code type of thing where i manipulate/instantiate etc. things from code instead of editor like taking a prefab and dragging it into desired script.

    What are your opinions on drag-drop way? is it better or worse (load times or otherwise).

    Personally i hate drag-drop as i reset some script w/ these prefabs set in them(by loading in different project or smth else) and i have to go thru setting all those pieces back in their places...
     
  2. passerbycmc

    passerbycmc

    Joined:
    Feb 12, 2015
    Posts:
    1,741
    Will getting direct references to objects with drag and drop is much better than using GameObject.Find more reliable and costs very little to do. Since it dosnt relie on magic strings you will be able go see any type errors before you compile and play as well.
     
  3. Deleted User

    Deleted User

    Guest

    Do what makes sense but performance wise drag-and-drop is much more efficient than Find. Also remember that you can drag and drop inactive objects but not find inactive ones.