Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
PGLDemo
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
测试练习
PGLDemo
Commits
176d23ea
Commit
176d23ea
authored
May 11, 2023
by
潘梓豪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
删除DTC脚本
parent
0136fcc1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
169 deletions
+0
-169
DTSceneManager.cs
Assets/Scripts/Components/DTSceneManager.cs
+0
-158
DTSceneManager.cs.meta
Assets/Scripts/Components/DTSceneManager.cs.meta
+0
-11
No files found.
Assets/Scripts/Components/DTSceneManager.cs
deleted
100644 → 0
View file @
0136fcc1
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
;
}
}
}
Assets/Scripts/Components/DTSceneManager.cs.meta
deleted
100644 → 0
View file @
0136fcc1
fileFormatVersion: 2
guid: 939681b655fda4749bd152be59946117
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment