| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108 |
- /// <summary>
- /// ZWN
- /// 跳转场景
- /// 20211011
- /// </summary>
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine.SceneManagement;
- using UnityEngine;
- using ET;
- public class Load_Scene : MonoBehaviour
- {
- public static Load_Scene single;
- bool start = false;
- void Awake()
- {
- single = this;
- }
- void Start()
- {
- if (!start)
- {
- //Log.Info("Start onpause");
- //zwn_common_data.single.zwn_data_cur.onpause(false);
- start = true;
- }
- }
- /// <summary>
- /// 设置跳转场景逻辑
- /// </summary>
- /// <param name="i"></param>
- public void load_scene_as(int i)
- {
- //zwn_common_data.single.zwn_data_cur.onpause(true);
- SceneManager.LoadSceneAsync(i);
- }
- public void load_scene_as_name(string name)
- {
- //zwn_common_data.single.zwn_data_cur.onpause(true);
- SceneManager.LoadScene(name);
- //SceneManager.LoadScene(name);
- }
- int cur;
- public int load_scene_string(string str)
- {
- cur = -1;
- /*if (str == "1001")
- {
- cur = 1;
- }
- if (str == "1002")
- {
- cur = 2;
- }
- if (str == "1003")
- {
- cur = 3;
- }
- if (str == "1004")
- {
- cur = 4;
- }
- if (str == "1005")
- {
- cur = 5;
- }
- if (str == "1006")
- {
- cur = 6;
- }*/
- if (str == "1001")
- {
- cur = 1;
- }
- if (str == "1002")
- {
- cur = 2;
- }
- if (str == "1004")
- {
- cur = 3;
- }
- if (str == "1005")
- {
- cur = 4;
- }
- if (str == "1006")
- {
- cur = 5;
- }
- if (cur == -1)
- {
- }
- else
- {
- //zwn_common_data.single.zwn_data_cur.onpause(true);
- SceneManager.LoadSceneAsync(cur);
- }
- return cur;
- }
- }
|