예제 #1
0
        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>());
        }
예제 #2
0
 public static GameObject Instantiate(PrefabFileInfos prefabInfos, Transform parent = null)
 {
     return(PrefabFile.Instantiate(prefabInfos.PrefabPath(), parent));
 }
예제 #3
0
 public static T Load <T>(PrefabFileInfos prefabInfos) where T : Component
 {
     return(Resources.Load <T>(string.Format("{0}/{1}", AppDataPath.PrefabFilePath, prefabInfos.PrefabPath())));
 }
예제 #4
0
 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()));
 }
예제 #5
0
 public static GameObject LoadAsync(PrefabFileInfos prefabInfos)
 {
     return(Resources.LoadAsync(string.Format("{0}/{1}", AppDataPath.PrefabFilePath, prefabInfos.PrefabPath())).get_asset() as GameObject);
 }