GameStart.cs 923 B

123456789101112131415161718192021222324252627282930313233
  1. using System.Reflection;
  2. using UnityEngine;
  3. using UnityEngine.Playables;
  4. public class GameStart : MonoBehaviour
  5. {
  6. public ShaderVariantCollection ShaderVariantCollection;
  7. public LoadType LoadType;
  8. public string h5Url;
  9. private GameStartUIPanel _gameStartUIPanel;
  10. public void Start()
  11. {
  12. ShaderVariantCollection.WarmUp();
  13. _gameStartUIPanel = GetComponent<GameStartUIPanel>();
  14. StartLoadGame();
  15. }
  16. private void StartLoadGame()
  17. {
  18. string typeName = "GameApplction";
  19. // lock (ActivatorLoock)
  20. {
  21. Assembly assembly = Assembly.Load("Fort23.Mono");
  22. System.Type type = assembly.GetType(typeName);
  23. IGameStart iGameStart = System.Activator.CreateInstance(type) as IGameStart;
  24. iGameStart.StartGame(LoadType, h5Url, _gameStartUIPanel, delegate { gameObject.SetActive(false); });
  25. }
  26. }
  27. }