Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using AC;
- using UnityEngine;
- using UnityEngine.SceneManagement;
- public class Load1Mult : MonoBehaviour {
- // Use this for initialization
- void Awake()
- {
- AC.KickStarter.TurnOnAC();
- GameObject inst = gameObject;
- this.gameObject.SetActive(true);
- DontDestroyOnLoad(inst);
- }
- private void OnEnable() { EventManager.OnFinishLoading += OnFinishLoading; }
- private void OnDisable() { EventManager.OnFinishLoading -= OnFinishLoading; }
- private void OnFinishLoading()
- {
- Debug.Log("hi4");
- KickStarter.sceneSettings.OnLoad();
- }
- public void StartLoad1()
- {
- leavehoteltotown();
- Invoke("Load1Thingy", 3);
- }
- public void StartLoad2()
- {
- leavehoteltotown();
- Invoke("Load2Thingy", 3);
- }
- public void StartLoad3()
- {
- leavehoteltotown();
- Invoke("Load3Thingy", 3);
- }
- public void Load1Thingy ()
- {
- AC.KickStarter.TurnOnAC(); //just to make sure
- this.gameObject.SetActive(true);
- AC.SaveSystem.LoadGame(1);
- }
- public void Load2Thingy()
- {
- AC.KickStarter.TurnOnAC();
- this.gameObject.SetActive(true);
- AC.SaveSystem.LoadGame(2);
- }
- public void Load3Thingy()
- {
- AC.KickStarter.TurnOnAC();
- this.gameObject.SetActive(true);
- AC.SaveSystem.LoadGame(3);
- }
- public void leavehoteltotown()
- {
- AC.KickStarter.sceneChanger.PrepareSceneForExit();
- AC.GlobalVariables.SetBooleanValue(373, false);
- PhotonNetwork.LeaveRoom();
- OnLeftRoomHoteltotown();
- }
- void OnLeftRoomHoteltotown()
- {
- PhotonNetwork.LoadLevel("joinmultiplayer");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement