Пример #1
0
 Cell[] findCellNear(Cell cellThis,Cell[] cells)
 {
     float radius=2;
     var list=new List<Cell>();
     foreach(Cell cell in cells){
     float dis=Vector2.Distance(new Vector2(cellThis.x,cellThis.y),new Vector2(cell.x,cell.y));
     if(dis<radius&&cellThis!=cell)list.Add(cell);
     }
     return list.ToArray();
 }
Пример #2
0
 public static int Distance(Cell a,Cell b)
 {
     // return Mathf.FloorToInt((a.pos-b.pos).magnitude/CellSetter.radius+0.1f);
     return Mathf.FloorToInt((a.pos-b.pos).magnitude);
 }
Пример #3
0
 internal void summon(Cell cell)
 {
     posTarget=cell.transform.position;
     this.cell=cell;
     transform.position=posTarget+Vector3.up*2;
     act("born");
 }
Пример #4
0
 private Chess setChess(Data.Card card,Cell cell)
 {
     Chess chess=chessesPrefab[0];
     foreach(var e in chessesPrefab){
     if(e.name==card.name)chess=e;
     }
     chess=Instantiate(chess) as Chess;
     chess.summon(cell);
     chess.transform.parent=parentChess;
     chess.bm=bm;
     bm.lChess.Add(chess);
     return chess;
     // lChess.Add(chess);
 }
Пример #5
0
 Vector3 findPos(Cell cell)
 {
     return Vector3.zero;
 }
Пример #6
0
 Chess findChess(Cell cell)
 {
     return null;
 }
Пример #7
0
 internal Chess summon(Data.Card card,Cell cell,string party)
 {
     var p=new Period();
     p.type="summon";
     var chess=setChess(Data.Card.find(card.name),cell);
     chess.party=party;
     chess.gameObject.SetActive(false);
     p.chesses=new Chess[]{chess};
     queuePeriod.Add(p);
     return chess;
 }