public static T Instantiate <T>(PrefabFileInfos prefabInfo, Transform parent = null) where T : Component { GameObject gameObject = Object.Instantiate(PrefabFile.Load(prefabInfo.PrefabPath()), Vector3.get_zero(), Quaternion.get_identity()) as GameObject; if (gameObject == null) { return((T)((object)null)); } if (parent != null) { gameObject.get_transform().set_parent(parent); } gameObject.get_transform().set_localScale(Vector3.get_one()); return(gameObject.SafeGetComponent <T>()); }
public static GameObject Instantiate(PrefabFileInfos prefabInfos, Transform parent = null) { return(PrefabFile.Instantiate(prefabInfos.PrefabPath(), parent)); }
public static T Load <T>(PrefabFileInfos prefabInfos) where T : Component { return(Resources.Load <T>(string.Format("{0}/{1}", AppDataPath.PrefabFilePath, prefabInfos.PrefabPath()))); }
public static T LoadAsync <T>(PrefabFileInfos prefabInfos) where T : Component { return((T)((object)Resources.LoadAsync <T>(string.Format("{0}/{1}", AppDataPath.PrefabFilePath, prefabInfos.PrefabPath())).get_asset())); }
public static GameObject LoadAsync(PrefabFileInfos prefabInfos) { return(Resources.LoadAsync(string.Format("{0}/{1}", AppDataPath.PrefabFilePath, prefabInfos.PrefabPath())).get_asset() as GameObject); }