/// <summary> /// 搜索消除 /// </summary> /// <param name="p">开始搜索的星星</param> void HandleClearMap(NPCStar p) { List <NPCStar> list = MMap.OnSearchMap(p.Point.x, p.Point.y, (e) => { return(p.IsPassTestSearch() && p.IsSameAsType(e)); }); int mCount = list.Count; if (mCount >= 3) { int L = list.Count; while (L-- > 0) { NPCStar e = list[L]; e.OnDestroy(); PlayEliminateEffect(e.transform.position); MMap.setMap(null, e.Point.x, e.Point.y); } PlayEliminateSoundEffect(mCount); GameUI.SetGameAddScore(ScoringComputation(list.Count)); } else { SCSound.game_cuowu(); } }
// 播放消除音效 void PlayEliminateSoundEffect(int count) { if (count >= 6) { SCSound.game_xiaochu03(); } else if (count >= 4) { SCSound.game_xiaochu02(); } else if (count >= 3) { SCSound.game_xiaochu01(); } else { } }
void Awake() { _single = this; InitScriptData(); }