Ejemplo n.º 1
0
    //이동 및 공격, 방어 행동 연산
    void Move(GameObject Unit, GameObject Tile)
    {
        Debug.Log(Unit + " " + Tile);
        UnitInfo unit = Unit.GetComponent <UnitInfo>();
        TileInfo SP   = GameData.data.FindTile(unit.x, unit.y);
        TileInfo EP   = Tile.GetComponent <TileInfo>();

        List <TileInfo> path = Calculator.Calc.Move(SP, EP, unit.Act);

        Debug.Log(path);
        if (path == null)
        {
            return;
        }
        if (unit.move != null)
        {
            StopCoroutine(unit.move);
        }
        unit.move = StartCoroutine(unit.Move(path));
    }