Esempio n. 1
0
        private static T LoadAssetFromAssetDatabase <T>(ParcelObject parcelObject) where T : Object
        {
#if UNITY_EDITOR
            return(UnityEditor.AssetDatabase.LoadAssetAtPath <T>(parcelObject.assetPath));
#else
            return(null);
#endif
        }
Esempio n. 2
0
        public static GameObject Instantiate(ParcelObject parcelObject)
        {
            if (!Application.isPlaying)
            {
                Debug.LogError("Error! Parcel is not used to Instantiate objects at Edit time.");
                return(null);
            }
            else
            {
                if (Application.isEditor)
                {
                    if (!ParcelSettings.instance.useAssetBundleInPlayMode)
                    {
                        LoadAssetFromAssetDatabase <GameObject>(parcelObject);
                    }
                }

                return(LoadAssetFromBundle <GameObject>(parcelObject));
            }
        }
Esempio n. 3
0
 private static T LoadAssetFromBundle <T>(ParcelObject parcelObject) where T : Object
 {
     return(null);
 }
Esempio n. 4
0
 /// <summary>
 /// Instantiate a new GameObject from Parcel using asset bundles at runtime and AssetDatabase at edit time.
 /// </summary>
 /// <param name="parcelObject">The parcel object that you want to Instantiate.</param>
 /// <returns>The instantiated prefab.</returns>
 public static GameObject Instantiate(this MonoBehaviour monobehaviour, ParcelObject parcelObject)
 {
     return(Instantiate(monobehaviour, parcelObject));
 }
Esempio n. 5
0
 /// <summary>
 /// Instantiate a new GameObject from Parcel using asset bundles at runtime and AssetDatabase at edit time.
 /// </summary>
 /// <param name="parcelObject">The parcel object that you want to Instantiate.</param>
 /// <returns>The instantiated prefab.</returns>
 public static GameObject Instantiate(this GameObject gameobject, ParcelObject parcelObject)
 {
     return(Instantiate(gameobject, parcelObject));
 }
Esempio n. 6
0
 /// <summary>
 /// Instantiate a new GameObject from Parcel using asset bundles at runtime and AssetDatabase at edit time.
 /// </summary>
 /// <param name="parcelObject">The parcel object that you want to Instantiate.</param>
 /// <returns>The instantiated prefab.</returns>
 public static GameObject Instantiate(this Transform transform, ParcelObject parcelObject)
 {
     return(Instantiate(transform, parcelObject));
 }