|
@@ -11,7 +11,7 @@ namespace GFGGame
|
|
|
|
|
|
public override void Dispose()
|
|
|
{
|
|
|
- if(_scenePrefab != null)
|
|
|
+ if (_scenePrefab != null)
|
|
|
{
|
|
|
GameObject.Destroy(_scenePrefab);
|
|
|
_scenePrefab = null;
|
|
@@ -37,7 +37,8 @@ namespace GFGGame
|
|
|
protected override void OnShown()
|
|
|
{
|
|
|
base.OnShown();
|
|
|
- if(_sceneObject == null)
|
|
|
+
|
|
|
+ if (_sceneObject == null)
|
|
|
{
|
|
|
_sceneObject = GameObject.Instantiate(_scenePrefab);
|
|
|
}
|
|
@@ -45,9 +46,14 @@ namespace GFGGame
|
|
|
StoryLevelCfg levelCfg = StoryLevelCfgArray.Instance.GetCfg(InstanceZonesDataManager.currentLevelCfgId);
|
|
|
StoryFightCfg fightCfg = StoryFightCfgArray.Instance.GetCfg(levelCfg.fightID);
|
|
|
SceneController.UpdateFightTarget(fightCfg.targetRes, _sceneObject);
|
|
|
+ if (!string.IsNullOrEmpty(fightCfg.music))
|
|
|
+ {
|
|
|
+ MusicManager.Instance.Play(ResPathUtil.GetMusicPath(fightCfg.music, "mp3"));
|
|
|
+ }
|
|
|
_ui.m_roleName.m_txtName.text = RoleDataManager.roleName;
|
|
|
_ui.m_targetName.m_txtName.text = fightCfg.targetName;
|
|
|
- Timers.inst.Add(1.1f, 1, (object param) => {
|
|
|
+ Timers.inst.Add(1.1f, 1, (object param) =>
|
|
|
+ {
|
|
|
this.Hide();
|
|
|
ViewManager.Show(ViewName.STORY_FIGHT_TARGET_SCORE_VIEW);
|
|
|
});
|
|
@@ -56,7 +62,7 @@ namespace GFGGame
|
|
|
protected override void OnHide()
|
|
|
{
|
|
|
base.OnHide();
|
|
|
- if(_sceneObject != null)
|
|
|
+ if (_sceneObject != null)
|
|
|
{
|
|
|
GameObject.Destroy(_sceneObject);
|
|
|
_sceneObject = null;
|