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. Dismiss Notice

Question How to make Creating prefabs with a for loop in the editor

Discussion in 'Editor & General Support' started by mehmetalihanaydin0841, Jul 29, 2023.

  1. mehmetalihanaydin0841

    mehmetalihanaydin0841

    Joined:
    Feb 25, 2021
    Posts:
    1
    if (GUI.Button(new Rect(0, 0, position.width, 40), "Instantiate Prefab"))
    {
    Selection.activeObject = PrefabUtility.InstantiatePrefab(Selection.activeObject as GameObject);
    }

    There is such a code. As much as I want to use a loop How can I create a prefab?

    (I used google translate. I'm sorry if I'm wrong)
     

    Attached Files:

  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,560