예제 #1
0
 public void ChoiceCell(Steps step, CellParam cell)
 {
     if (step == Steps.player)
     {
         var cellEvent = CreateEvent(cell.Id, step, true);
         DeleteColider();
         foreach (var cellChoise in _cellParamList[cellEvent.X])
         {
             if (cellChoise.Touch)
             {
                 continue;
             }
             cellChoise.BaseCellObject.GetComponent <SpriteRenderer>().color = Color.blue;
             if (cellChoise.BaseCellObject.GetComponent <BoxCollider2D>() == null)
             {
                 cellChoise.BaseCellObject.AddComponent <BoxCollider2D>();
             }
         }
     }
     else
     {
         var cellEvent = CreateEvent(cell.Id, step, true);
         DeleteColider();
         foreach (var cellChoise in _cellParamList)
         {
             if (cellChoise[cellEvent.Y].Touch)
             {
                 continue;
             }
             cellChoise[cellEvent.Y].BaseCellObject.GetComponent <SpriteRenderer>().color = Color.blue;
             if (cellChoise[cellEvent.Y].BaseCellObject.GetComponent <BoxCollider2D>() == null)
             {
                 cellChoise[cellEvent.Y].BaseCellObject.AddComponent <BoxCollider2D>();
             }
         }
     }
 }
예제 #2
0
        public void ChoiceCell(Steps step, CellParam cell)
        {

            if (step == Steps.player)
            {
                var cellEvent = CreateEvent(cell.Id, step, true);
                DeleteColider();
                foreach (var cellChoise in _cellParamList[cellEvent.X])
                {
                    if (cellChoise.Touch)
                        continue;
                    cellChoise.BaseCellObject.GetComponent<SpriteRenderer>().color = Color.blue;
                    if (cellChoise.BaseCellObject.GetComponent<BoxCollider2D>() == null)
                        cellChoise.BaseCellObject.AddComponent<BoxCollider2D>();
                }

            }
            else
            {
                var cellEvent = CreateEvent(cell.Id, step, true);
                DeleteColider();
                foreach (var cellChoise in _cellParamList)
                {
                    if (cellChoise[cellEvent.Y].Touch)
                        continue;
                    cellChoise[cellEvent.Y].BaseCellObject.GetComponent<SpriteRenderer>().color = Color.blue;
                    if (cellChoise[cellEvent.Y].BaseCellObject.GetComponent<BoxCollider2D>() == null)
                        cellChoise[cellEvent.Y].BaseCellObject.AddComponent<BoxCollider2D>();
                }
            }
        }