VR Development Framework
v 1.0.0
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events Pages
static GameObject AVR.UEditor.Core.AVR_EditorUtility.InstantiatePrefabAsChild ( Transform  parent,
string  settings_token 
)
inlinestatic

Definition at line 19 of file _AVR_Core_EditorUtility.cs.

19  {
20  Object prefab = AssetDatabase.LoadAssetAtPath(AVR.Core.AVR_Settings.get_string(settings_token), typeof(GameObject));
21  if (prefab == null)
22  {
23  AVR.Core.AVR_DevConsole.error("There is a prefab missing at: " + AVR.Core.AVR_Settings.get_string(settings_token));
24  return null;
25  }
26  else
27  {
28  GameObject o = (GameObject)PrefabUtility.InstantiatePrefab(prefab);
29  o.transform.SetParent(parent);
30  o.transform.localPosition = Vector3.zero;
31  o.transform.localRotation = Quaternion.identity;
32  AVR.Core.AVR_DevConsole.success("Instantiated Prefab. Token: " + settings_token);
33  return o;
34  }
35  }