Commit 7a128278 authored by wanqing's avatar wanqing

音效优化,第7关目标胜利优化

parent e6acd238
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class SevenLevelOneTrigger : MonoBehaviour
{
public SevenLevelTwoTrigger m_levelTwo;
private bool m_bControl = true;
private void OnTriggerEnter(Collider other)
{
if (other.gameObject.CompareTag("Target") && m_bControl)
{
m_bControl = false;
m_levelTwo.OnTriggerOne();
GameServices.timerServices.Push(this, 1.0f, delegate
{
if (m_levelTwo.Control)
{
m_bControl = true;
}
});
}
}
}
fileFormatVersion: 2
guid: 2b25b3be45f8fea47af893c4c5878f11
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class SevenLevelTwoTrigger : MonoBehaviour
{
private bool m_bTriggerOne = false;
private bool m_bTriggerTwo = false;
private bool m_bControl = true;
public bool Control => m_bControl;
private void OnTriggerEnter(Collider other)
{
if (other.gameObject.CompareTag("Target") && !m_bTriggerTwo)
{
m_bTriggerTwo = true;
if (m_bTriggerTwo && m_bTriggerOne)
{
if (m_bControl)
{
m_bControl = false;
BattleCtrl.instance.OnBattleWin();
BattleCtrl.instance.levelManager.curLevel.chainRopeView.CatchObjEnterTarget();
}
}
GameServices.timerServices.Push(this, 1.0f, delegate
{
if (m_bControl)
{
m_bTriggerTwo = false;
}
});
}
}
public void OnTriggerOne()
{
m_bTriggerOne = true;
if (m_bTriggerTwo && m_bTriggerOne)
{
if (m_bControl)
{
m_bControl = false;
BattleCtrl.instance.OnBattleWin();
BattleCtrl.instance.levelManager.curLevel.chainRopeView.CatchObjEnterTarget();
}
}
GameServices.timerServices.Push(this, 1.0f, delegate
{
if(m_bControl)
{
m_bTriggerOne = false;
}
});
}
}
fileFormatVersion: 2
guid: 96b3f7c7804939e419b2a96df4f71521
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
...@@ -202,7 +202,7 @@ public class BattleUI : MonoBehaviour ...@@ -202,7 +202,7 @@ public class BattleUI : MonoBehaviour
//{ //{
// GameServices.audioServices.PlayBgm(GameServices.configService.audioConfig.GameBgm); // GameServices.audioServices.PlayBgm(GameServices.configService.audioConfig.GameBgm);
//}); //});
GameServices.audioServices.PlayAudio(GameServices.configService.audioConfig.GetFail()); //GameServices.audioServices.PlayAudio(GameServices.configService.audioConfig.GetFail());
} }
/// 加载关卡前调用,隐藏不需要显示的ui /// 加载关卡前调用,隐藏不需要显示的ui
public void OnBeforeLoadLevel() public void OnBeforeLoadLevel()
......
...@@ -45,7 +45,7 @@ public class SettingPanel : MonoBehaviour ...@@ -45,7 +45,7 @@ public class SettingPanel : MonoBehaviour
} }
else else
{ {
m_bgmImageObj.SetActive(true); m_bgmImageObj.SetActive(false);
} }
} }
//震动 //震动
......
...@@ -86,7 +86,7 @@ public class AudioServices : MonoBehaviour ...@@ -86,7 +86,7 @@ public class AudioServices : MonoBehaviour
public void PlayBgm(AudioClip clip) public void PlayBgm(AudioClip clip)
{ {
if(LocalRecord.HasKey(GlobalConfig.BgmKey) && LocalRecord.GetIntRecord(GlobalConfig.BgmKey) == 0) if(!LocalRecord.HasKey(GlobalConfig.BgmKey) || LocalRecord.GetIntRecord(GlobalConfig.BgmKey) == 0)
{ {
return; return;
} }
......
This source diff could not be displayed because it is too large. You can view the blob instead.
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