private IEnumerator CascadeJewelFromQueue() { IRuntimeJewel jq = JewelsToFall.Dequeue(); Vector2 BoardTo = BoardPos.OffsetJewelByPosition(jq.Pos); Vector2 BoardFrom = BoardPos.OffsetJewelByPosition(jq.LastPos); Vector3 to = BoardPos.GetNextJewelPosition(BoardTo, utils.DeckPosition.position); Vector3 from = jq.IsNew() ? new Vector3(to.x, BoardPos.GetBoardTopPos().y, to.z) : new Vector3(to.x, BoardPos.GetNextJewelPosition(BoardFrom, utils.DeckPosition.position).y, to.z); if (jq.IsNew()) { var uiJewel = UiJewelPool.Instance.Get(jq); IUiJewelComponents comp = uiJewel.MonoBehavior.GetComponent <IUiJewelComponents>(); //comp.UIRuntimeData.OnSetData(jq); uiJewel.MonoBehavior.name = jq.JewelID; uiJewel.transform.position = from; utils.PlayerBoard.AddJewel(uiJewel); } yield return(new WaitForSeconds(utils.JEWELFALLDELAY)); if (jq.IsNew() || jq.LastPos.y != jq.Pos.y) { OnNotifyPositionChange(jq, from, to); } if (JewelsToFall.Count > 0) { JewelsFalling = utils.MBehaviour.StartCoroutine(CascadeJewelFromQueue()); } else { yield return(new WaitForSeconds(.2f)); CheckEndCascade(); } }
public UIJewelDestroy(IUiJewelComponents Parent) { Parent.UIRuntimeData.OnSetData += ExecuteData; Parent.OnRemove += ExecuteDestroy; parent = Parent; }
public UIJewelPosition(IUiJewelComponents Parent) { Parent.UIRuntimeData.OnSetData += Execute; parent = Parent; transform = Parent.transform; }
public UIJewelSprite(IUiJewelComponents Parent) { Parent.UIRuntimeData.OnSetData += Execute; SprRend = Parent.Renderer; parent = Parent; }
public static void Format(IUiJewelComponents jewelComp, UiJewelParameters param) { jewelComp.MonoBehavior.transform.localScale *= param.JewelScale; }
public UIJewelTransform(IUiJewelComponents parent) { parent.UIRuntimeData.OnSetData += Execute; this.transform = parent.transform; }
public UIJewelBoxCollider(IUiJewelComponents parent) { parent.UIRuntimeData.OnSetData += Execute; this.collider = parent.BoxCollider; }