Commit dc071be0 authored by 郭启麟's avatar 郭启麟

Merge branch 'master' of git@gitlab.sd-zeus.com:testcii/pgldemo.git

parents b52c2520 176d23ea
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
using Zeus.UIS;
using Cinemachine;
using UnityEngine.Playables;
using Zeus.RTEditor;
/// <summary>
/// 用于提供一般场景的控制功能
/// </summary>
public class DTSceneManager : MonoBehaviour
{
public UIS_CharacterController Player;
public PlayableDirector NavigationController;
public GameObject AutoWalkController;
public LoadingUI LoadingTipsUI;
public Toggle NavigationToggle;
public Toggle AutoWalkToggle;
public Toggle ManualToggle;
public EditorManager Editor;
public UnityEvent OnLoadedOtherScene;
private Scene _currentScene;
protected AsyncOperation _loadOperation;
// Start is called before the first frame update
void Start()
{
string dp = ES3.LoadString("DefaultPath", "");
//if (!string.IsNullOrEmpty(dp))
//{
// Editor.Load(dp);
//}
NavigationToggle?.onValueChanged.AddListener((b) =>
{
if (b)
{
EnterNavigationMod();
}
});
AutoWalkToggle?.onValueChanged.AddListener((b) =>
{
if (b)
{
EnterAutoWalkMod();
}
});
ManualToggle?.onValueChanged.AddListener((b) =>
{
if (b)
{
EnterManualMod();
}
});
if (NavigationToggle.isOn)
{
EnterNavigationMod();
}
else if (AutoWalkToggle.isOn)
{
EnterAutoWalkMod();
}
else if (ManualToggle.isOn)
{
EnterManualMod();
}
}
// Update is called once per frame
void Update()
{
}
public void EnterNavigationMod()
{
SetEnterViewMod(true);
NavigationController.gameObject.SetActive(true);
AutoWalkController.gameObject.SetActive(false);
}
public void EnterAutoWalkMod()
{
//SetEnterViewMod(true);
AutoWalkController.gameObject.SetActive(true);
NavigationController.gameObject.SetActive(false);
}
public void EnterManualMod()
{
SetEnterViewMod(false);
AutoWalkController.gameObject.SetActive(false);
NavigationController.gameObject.SetActive(false);
}
public void SetEnterViewMod(bool enter)
{
//if (enter)
//{
// Player.EnterViewMod.TryStart();
// Player.EnterViewMod.TryStop();
//}
//else
//{
// Player.QuitViewMod.TryStart();
// Player.QuitViewMod.TryStop();
//}
}
public void LoadSence(string scene_name)
{
_currentScene = SceneManager.GetActiveScene();
_loadOperation = SceneManager.LoadSceneAsync(scene_name, LoadSceneMode.Additive);
_loadOperation.completed += OnComplectLoadScene;
LoadingTipsUI.gameObject.SetActive(true);
StartCoroutine(_waitLoading());
}
protected void OnComplectLoadScene(AsyncOperation operation)
{
LoadingTipsUI.gameObject.SetActive(false);
OnLoadedOtherScene.Invoke();
SceneManager.UnloadSceneAsync(_currentScene);
}
protected IEnumerator _waitLoading()
{
while (_loadOperation.progress < 1)
{
Debug.Log(_loadOperation.progress);
LoadingTipsUI.Tips.text = $"正在加载场景:{(_loadOperation.progress * 100).ToString("0.00")}";
yield return null;
}
}
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class MainScene : MonoBehaviour
{
public static MainScene _mainScene;
// Start is called before the first frame update
void Start()
{
_mainScene = this;
}
// Update is called once per frame
void Update()
{
}
}
fileFormatVersion: 2
guid: 939681b655fda4749bd152be59946117
guid: cbe97884a3936fd47a27b9323a744b72
MonoImporter:
externalObjects: {}
serializedVersion: 2
......
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using TMPro;
using UnityEngine.UI;
public class MainUI : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
}
//˳
public void quite()
{
Application.Quit();
}
}
fileFormatVersion: 2
guid: 1c97e98195b098b46a1615c3e6f16de2
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
Subproject commit d3f4ff62c029a25a0979f7eda6c8faf823c158ca
Subproject commit 2d48f1086c85d81f497f7f44aa4694e35a8e9cb4
Subproject commit f67a7a65890ea05d0133a4633a1551e2d5b22c6a
Subproject commit 82159aa54580e76dde554eeee08316bd3aebb193
Subproject commit a6d3b196c60e0283dd7bc925e8f9fb4a7c63e9bc
Subproject commit 0444056580395bb955cd9d9889e57ad8ee6a7338
Subproject commit 1fc0a8236a654df37afffa496d12cd88e452d990
This diff is collapsed.
fileFormatVersion: 2
guid: 948ef33a60f448d4bb65eb2281582b7e
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment