Esempio n. 1
0
 //show the range of pawn
 public void showRange(Coordinate[] move_range_list, Coordinate[] attack_range_list, bool clicked)
 {
     refreshGridState ();
     showMoveRange (move_range_list);
     showAttackRange (attack_range_list);
     if (clicked) {
         reserved = true;
         Coordinate[] range_list = move_range_list.Concat(attack_range_list).ToArray();
         ReservedGirdsList = range_list.Distinct().ToArray();
         ReservedStatesList = getGridsState(ReservedGirdsList);
     }
 }
Esempio n. 2
0
    // Use this for initialization
    void Start()
    {
        /*
         * int i;
         * for (i=0; i<pathPoints.Length; i++)
         *      pathPoints [i] *= gridScale;
         * transform.DOPath (pathPoints, pathPoints.Length * gridMoveDuration, PathType.Linear);
         */
        Coordinate[] range_list1 = new Coordinate[] { new Coordinate(0, 0), new Coordinate(1, 0), new Coordinate(1, 1) };
        Coordinate[] range_list2 = new Coordinate[] { new Coordinate(0, 0), new Coordinate(1, 0), new Coordinate(3, 1), new Coordinate(1, 1), new Coordinate(1, 9) };

        Coordinate[] range_catt1 = range_list1.Concat(range_list2).ToArray();
        range_catt1 = range_catt1.Distinct().ToArray();

        foreach (Coordinate element in range_catt1)
        {
            Debug.Log(element.toString());
        }
    }