GameStart.cs 883 B

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