示例#1
0
        public bool Apply()
        {
            BoosterFunc bF = SceneObject.GetComponent <BoosterFunc>();

            return(bF.ActivateApply(this));
            // return false;
        }
示例#2
0
        public void ApplyShootBubbleToGrid(GridCell hitGridCell, GridCell freeGridCell, CellsGroup shootGridCellsArea)
        {
            if (debug)
            {
                Debug.Log("apply shoot bubble");
            }

            if (MData != null) // regular object shoot bubble, set new mainobject and destroy shootbubble
            {
                if (shootGridCellsArea.Length < 2)
                {
                    BubbleGrid.Instance.SetMainObject(freeGridCell, MData);
                }

                DestroyImmediate(gameObject);
            }
            else // possible booster
            {
                BoosterFunc bF = GetComponent <BoosterFunc>();
                if (bF)
                {
                    bF.ApplyBooster(hitGridCell, freeGridCell, shootGridCellsArea);
                }
            }

            if (hitGridCell)
            {
                hitGridCell.ShootHit(null);
            }
        }
示例#3
0
        /// <summary>
        /// Get shoot area around target free grid cell
        /// </summary>
        /// <param name="hitGCell"></param>
        /// <param name="freeGCell"></param>
        /// <param name="grid"></param>
        /// <returns></returns>
        public CellsGroup GetShootArea(GridCell hitGCell, GridCell freeGCell, BubbleGrid grid)
        {
            if (debug)
            {
                Debug.Log("shootbubble get shoot area");
            }
            BoosterFunc bF = GetComponent <BoosterFunc>();

            if (bF)
            {
                return(bF.GetShootArea(hitGCell, freeGCell, grid));
            }
            else
            {
                return(grid.GetIdArea(freeGCell, MData.ID));
            }
        }
示例#4
0
        public void Apply(GridCell gCell, Action completeCallBack)
        {
            if (!gCell)
            {
                completeCallBack?.Invoke(); return;
            }
            if (!footerBooster)
            {
                completeCallBack?.Invoke(); return;
            }
            if (gCell.IsDisabled)
            {
                completeCallBack?.Invoke(); return;
            }
            if (gCell.Blocked)
            {
                completeCallBack?.Invoke(); return;
            }
            //  if (!gCell.Match) { completeCallBack?.Invoke(); return; }

            BoosterFunc bF = SceneObject.GetComponent <BoosterFunc>();

            bF.ApplyToGrid(gCell, bData, completeCallBack);
        }