- Home /
Question by
SaphiBlue · Mar 13, 2017 at 08:10 PM ·
editor-scriptingprefabsresources.load
Update a Prefab in the Resources Folder in Edit-Mode by a Script
Hello,
is there a way to Update a Prefab property by a C# Script while I'm in the Editor?
I want to Update/Set the Path of the Prefab as a Script property whtin the Prefab to handle the Resource Loading in the Runtime.
For a few Prefabs it is no Problem to do this by Hand, but if I have a bunch of Prefabs this will take much time and is a souce of errors.
So every Prefab has a Script like:
using UnityEngine;
using UnityEngine.Networking;
using System.Collections;
public class Item : NetItem {
public string path; // this I want so set by a Script
//more variables
void Start()
{
// some lines of Code
}
}
The Script sholud only run If I change something in the Prefab or I move it to an other Folder.
Has someone an Idea?
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220612112935im_/https://answers.unity.com/themes/thub/images/avi.jpg)