-
I wanted to write a plugin which will add a component to a GameObject. I managed to add a MonoBehavior to the asset infos but I'm a bit stumped on how to actually add it to the GameObject. here's my original attempt but this doesn't even get past the if statement because the game object doesn't have a BaseValueField. foreach (var item in selection.Where((item) => item.ClassId == (int)AssetClassID.GameObject))
{
Console.WriteLine(item.HasValueField);
if (item.BaseValueField == null) continue;
var comp = item.BaseValueField["m_Component"];
// Add another component here???
} |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
The BaseValueField name is a little misleading and that field will be removed entirely in the new UABEA update. Its main purpose was to hold on to user made edits (like if you import dump). To read the base field for the first time, you should use actually use |
Beta Was this translation helpful? Give feedback.
The BaseValueField name is a little misleading and that field will be removed entirely in the new UABEA update. Its main purpose was to hold on to user made edits (like if you import dump). To read the base field for the first time, you should use actually use
workspace.GetBaseField(container)
.