Advertisement
Guest User

Untitled

a guest
Nov 22nd, 2014
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 KB | None | 0 0
  1. IEnumerator LoadClass(string scriptname)
  2. {
  3. string url = "http://www.mywebsite.com/mygame/assetbundles/assetbundle1.unity3d";
  4. WWW www = WWW.LoadFromCacheOrDownload(url, 1);
  5. Debug.Log("Done1");
  6. // Wait for download to complete
  7. yield return www;
  8. MonoScript AppLocation = Resources.Load("phone/applications/Apps/AppsScript", typeof(MonoScript)) as MonoScript;
  9. Debug.Log(AppLocation);
  10.  
  11. var type = AppLocation.GetType();
  12. // Debug.Log(type.GetMethod("start"));
  13.  
  14. if (type != null)
  15. { // I want all the declared methods from the specific class.
  16. System.Reflection.MethodInfo[] methods = type.GetMethods(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.DeclaredOnly);
  17. Debug.Log("METYH");
  18. Debug.Log(methods[4]);
  19. }
  20. var k = AppLocation.ToString();
  21.  
  22. ConstructorInfo[] j = type.GetConstructors();
  23. Debug.Log(k);
  24. //type.GetMethods
  25. GameObject go = new GameObject();
  26. go.AddComponent(type);
  27. Debug.Log("Done0");
  28.  
  29. // type.GetMethod("loadApp");
  30. //Phone myCommonClass = ScriptableObject.CreateInstance(type.GetClass()) as Phone;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement