RegisterBundlesManager.cs 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. using UnityEngine;
  2. namespace I2.Loc
  3. {
  4. public class RegisterBundlesManager : MonoBehaviour, IResourceManager_Bundles
  5. {
  6. public void OnEnable()
  7. {
  8. if (!ResourceManager.pInstance.mBundleManagers.Contains(this))
  9. {
  10. ResourceManager.pInstance.mBundleManagers.Add(this);
  11. }
  12. }
  13. public void OnDisable()
  14. {
  15. ResourceManager.pInstance.mBundleManagers.Remove(this);
  16. }
  17. public virtual Object LoadFromBundle(string path, System.Type assetType)
  18. {
  19. // load from a bundle using path and return the object
  20. return null;
  21. }
  22. }
  23. // To use bundles, create a class similar to this one
  24. // and add it to one of your scenes
  25. //
  26. /*public class CustomBundlesManager : RegisterBundlesManager
  27. {
  28. public override Object LoadFromBundle(string path, System.Type assetType )
  29. {
  30. // load from a bundle using path and return the object
  31. return null;
  32. }
  33. }
  34. */
  35. }