public override void HitBottom(bool hitForward) { if (_isBroken == true) { return; } _hitForward = hitForward; GameObject go; Vector3 pos; _isBroken = true; Sequence seq = DOTween.Sequence(); seq.Append(SptMain.transform.DOMoveY(SptMain.transform.position.y + 0.5f, 0.1f).OnComplete(() => { SptMain.sprite = GameMap.instance.SptWallFixedCorner4; switch (_subtype) { case LevelElementQuestion.Type_CoinOne: go = (GameObject)GameObject.Instantiate(GameMap.instance.GoMapElementCoin); go.transform.SetParent(GameMap.instance.GoGameMap.transform); go.transform.position = transform.position; go.SetActive(true); CoinElement element = (CoinElement)go.GetComponent <CoinElement> (); element.SetSubtype(0); DOTween.Play(go.transform.DOMoveY(transform.position.y + 5.5f, 2.2f).OnComplete(() => { GameObject.Destroy(go); })); break; case LevelElementQuestion.Type_CoinFive: for (int m = 0; m < 5; m++) { go = (GameObject)GameObject.Instantiate(GameMap.instance.GoMapElementCoinEject); go.transform.SetParent(GameMap.instance.GoGameMap.transform); pos = transform.position; pos.y += 0.8f; go.transform.position = pos; go.SetActive(true); CoinEject coinEject = (CoinEject)go.GetComponent <CoinEject> (); int sign = 1; if (_hitForward == false) { sign = -1; } coinEject.SetColor(GameMap.instance.MapElementMainColor); coinEject.EjectOut(sign); GameMap.instance.AddActiveElement(coinEject); } break; case LevelElementQuestion.Type_AwardLife: case LevelElementQuestion.Type_AwardStar: { go = (GameObject)GameObject.Instantiate(GameMap.instance.GoMapElementBounceAward); go.transform.SetParent(GameMap.instance.GoGameMap.transform); pos = transform.position; pos.y += 0.8f; go.transform.position = pos; go.SetActive(true); BounceAward bounceAward = (BounceAward)go.GetComponent <BounceAward> (); switch (_subtype) { case LevelElementQuestion.Type_AwardLife: bounceAward.SetSubtype(BounceAward.Subtype_AwardLife); break; case LevelElementQuestion.Type_AwardStar: bounceAward.SetSubtype(BounceAward.Subtype_AwardStar); break; } bounceAward.SetColor(GameMap.instance.MapElementMainColor); int sign = 1; if (_hitForward == false) { sign = -1; } bounceAward.EjectOut(sign); GameMap.instance.AddActiveElement(bounceAward); break; } case LevelElementQuestion.Type_Mushroom: { go = (GameObject)GameObject.Instantiate(GameMap.instance.GoMapElementMushroom); go.transform.SetParent(GameMap.instance.GoGameMap.transform); pos = transform.position; pos.y += 0.8f; go.transform.position = pos; go.SetActive(true); Mushroom mushroom = (Mushroom)go.GetComponent <Mushroom> (); mushroom.SetColor(GameMap.instance.MapElementMainColor); int sign = 1; if (_hitForward == false) { sign = -1; } mushroom.EjectOut(sign); GameMap.instance.AddActiveElement(mushroom); break; } } })); seq.Append(SptMain.transform.DOMoveY(SptMain.transform.position.y, 0.3f)); DOTween.Play(seq); }