Advertisement
Guest User

Untitled

a guest
Oct 14th, 2022
35
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.59 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using AC;
  4. using UnityEngine;
  5. using UnityEngine.SceneManagement;
  6.  
  7. public class Load1Mult : MonoBehaviour {
  8.  
  9.  
  10. // Use this for initialization
  11. void Awake()
  12. {
  13. AC.KickStarter.TurnOnAC();
  14. GameObject inst = gameObject;
  15. this.gameObject.SetActive(true);
  16. DontDestroyOnLoad(inst);
  17. }
  18.  
  19. private void OnEnable() { EventManager.OnFinishLoading += OnFinishLoading; }
  20. private void OnDisable() { EventManager.OnFinishLoading -= OnFinishLoading; }
  21.  
  22. private void OnFinishLoading()
  23. {
  24. Debug.Log("hi4");
  25. KickStarter.sceneSettings.OnLoad();
  26. }
  27.  
  28. public void StartLoad1()
  29. {
  30. leavehoteltotown();
  31. Invoke("Load1Thingy", 3);
  32.  
  33. }
  34. public void StartLoad2()
  35. {
  36. leavehoteltotown();
  37. Invoke("Load2Thingy", 3);
  38.  
  39. }
  40. public void StartLoad3()
  41. {
  42. leavehoteltotown();
  43. Invoke("Load3Thingy", 3);
  44.  
  45. }
  46.  
  47.  
  48.  
  49.  
  50. public void Load1Thingy ()
  51. {
  52. AC.KickStarter.TurnOnAC(); //just to make sure
  53. this.gameObject.SetActive(true);
  54. AC.SaveSystem.LoadGame(1);
  55. }
  56.  
  57.  
  58. public void Load2Thingy()
  59. {
  60. AC.KickStarter.TurnOnAC();
  61. this.gameObject.SetActive(true);
  62. AC.SaveSystem.LoadGame(2);
  63. }
  64. public void Load3Thingy()
  65. {
  66. AC.KickStarter.TurnOnAC();
  67. this.gameObject.SetActive(true);
  68. AC.SaveSystem.LoadGame(3);
  69. }
  70.  
  71. public void leavehoteltotown()
  72. {
  73. AC.KickStarter.sceneChanger.PrepareSceneForExit();
  74. AC.GlobalVariables.SetBooleanValue(373, false);
  75. PhotonNetwork.LeaveRoom();
  76. OnLeftRoomHoteltotown();
  77. }
  78.  
  79. void OnLeftRoomHoteltotown()
  80. {
  81. PhotonNetwork.LoadLevel("joinmultiplayer");
  82. }
  83. }
  84.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement