private SkillPointEffect MakeSkillEffect(int type) { SkillPointEffect skillPoint = PoolManager.GetObject <SkillPointEffect>(); skillPoint.mTrans.parent = GameManager.tileRoot; skillPoint.mTrans.localScale = Vector3.one; skillPoint.Init(type); return(skillPoint); }
//해당 위치의 블록을 지우는 함수. // private void ClearBlocks(List <Pos> clearBlocksList, bool showEffect, System.Action <int> callback) { int allClearBlocksCount = clearBlocksList.Count; int clearCount = 0; int addedScore = 0; int ranIdx = Random.Range(0, moveCurves.Length); AnimationCurve moveCurve = moveCurves[ranIdx]; ranIdx = Random.Range(0, speedCurves.Length); AnimationCurve speedCurve = speedCurves[ranIdx]; for (int i = 0; i < allClearBlocksCount; i++) { int colorType; if (mapData.GetBlockOnMap(clearBlocksList[i]).TryGetColorType(out colorType)) { petAssistance.AddExp(colorType, 1); } Vector3 pos = GetBlockPosition(clearBlocksList[i]); addedScore += scoreAssistance.AddScore(pos); if (showEffect && DataManager.GetInstance().GetSelectedPetData(colorType) != null) { SkillPointEffect skillPoint = MakeSkillEffect(colorType); skillPoint.MoveTo(moveCurve, speedCurve, pos, expPos[(int)colorType], null); } mapData.GetBlockOnMap(clearBlocksList[i]).ClearBlock(() => { clearCount++; //모든 블록이 제거되면, // if (clearCount >= allClearBlocksCount) { if (callback != null) { callback(allClearBlocksCount); } } }); } MissionManager.GetInstance().AddScore(addedScore); }