GrayBlock GetGrayBlock(iVector3 position) { GrayBlock grayBlock = null; GameBlock gameBlock = InGameManager.Instance.GetGameBlock(position); if (gameBlock != null) { grayBlock = gameBlock.GetComponent <GrayBlock>(); } return(grayBlock); }
bool CheckGrayBlock(iVector3 position) { if (!BlockTools.ValidPos(position)) { return(false); } GameBlock gameBlock = InGameManager.Instance.GetGameBlock(position); if (gameBlock != null) { GrayBlock grayBlock = gameBlock.GetComponent <GrayBlock>(); if (grayBlock != null) { return(true); } } return(false); }
IEnumerator FlyStar(int index, GameBlock gameBlock) { GameObject dummyStar = new GameObject("DummyStar"); //GameObject star = Instantiate(Resources.Load<GameObject>("Prefabs/FX_LightBall_A")); GameObject star = PoolManager.Instance.GetPool(PoolType.FX_LightBall_A).gameObject; star.SetActive(true); RectTransform starRTr = dummyStar.AddComponent <RectTransform>(); star.transform.SetParent(ParticleManager.Instance.particleCanvasF.transform); dummyStar.transform.SetParent(rocket.transform); starRTr.anchoredPosition3D = new Vector3(-450f, 300f, 0f); starRTr.localScale = Vector3.one; FollowUI ui = star.AddComponent <FollowUI>(); ui.bFollow = true; ui.target = positionList[index].gameObject.GetComponent <RectTransform>(); ui.subTarget = starRTr; float speed = 4f; iVector3 p = new iVector3(gameBlock.pos.x, gameBlock.pos.y, gameBlock.pos.z); star.GetComponent <RectTransform>().anchoredPosition3D = Vector3.zero; star.transform.localScale = Vector3.one; FX_Electric.gameObject.SetActive(true); FX_Electric.Play(); SoundManager.Instance.PlayEffect("eff_plasma"); SoundManager.Instance.PlayEffect("eff_finale"); dummyStar.transform.SetParent(gameBlock.transform); while ((starRTr.anchoredPosition3D).sqrMagnitude > 100f) { starRTr.anchoredPosition3D = Vector3.Lerp(starRTr.anchoredPosition3D, Vector3.zero, Time.deltaTime * speed); yield return(null); if (starRTr == null) { break; } } star.SetActive(false); dummyStar.SetActive(false); //ParticleManager.Instance.SetParticle(ParticleType.ParticleF, Particle.FX_SpreadStar, positionList[BlockTools.iVector3ToIndex(p)].GetComponent<RectTransform>()); GameObject fx_SpreadStar = PoolManager.Instance.GetPool(PoolType.FX_SpreadStar).gameObject; ParticleManager.Instance.SetParticle(ParticleType.ParticleF, fx_SpreadStar, positionList[BlockTools.iVector3ToIndex(p)].GetComponent <RectTransform>()); if (gameBlock != null) { ColorBlock colorBlock = gameBlock.GetComponent <ColorBlock>(); if (colorBlock != null) { colorBlock.DestroyObject(); } GrayBlock grayBlock = gameBlock.GetComponent <GrayBlock>(); if (grayBlock != null) { grayBlock.DestroyObject(); } } //이떄 생성되는 느낌의 파티클 한개더 //ItemBlock itemBlock = Instantiate(Resources.Load<GameObject>("Prefabs/ItemBlock")).GetComponent<ItemBlock>(); ItemBlock itemBlock = PoolManager.Instance.GetPool(PoolType.ItemBlock).GetComponent <ItemBlock>(); itemBlock.gameObject.SetActive(true); itemBlock.pos = p; itemBlock.itemType = (ItemType)UnityEngine.Random.Range(0, 2); itemBlock.transform.SetParent(positionList[index].transform); itemBlock.transform.localPosition = Vector3.zero; itemBlock.transform.localScale = Vector3.one; itemBlock.bIsParentPos = true; itemBlock.Initialize(); }