Unity - A计划(永久有效期) 扫二维码继续学习 二维码时效为半小时

(196评价)
价格: 4049.00元

if(Inout.GetMosueButton(0))

{

  player.transform.GetChild(0),transform.position+=new Vector3(Input.GetAxis("Mouse X"),0,0);

}

[展开全文]
gaoziYY · 2020-01-23 · 0

private static double H(Point pnt)

{

return HManhattanDistance(pnt);

}

[展开全文]
gaoziYY · 2020-01-24 · 0

List<PointData>openList = new List<PointData>();

openList.Add(new PointData(START_PNT,0,0,null));

PointData endPoint = null

for(bool finish = false;!finish&&openList.Count>0;)

{

openList.Sort((x,y)=>{return x.F().CompareTo(y.F());});//最小在上最大在下,降序排列

PointData data = openList[0];

openList.RemoveAt(0);//最小值从开列表去除

Point point = data.point;

if(MAP[point.x,point.y] == SPACE)

{

MAP[point.x,point.y] = VISITED;

}

for(int i = 0;i<directs.Rank;i++){

Point newPoint = new Point(point.x+directs[i,0],point.y+directs[i,1]);

if(newPnt.x>=0&&newPnt.x<MAX_PNT.x&&newPnt.y>=0&&newPnt.y<MAX_PNT.y){

char e = MAP[newPoint.x,newPoint.y];

if(e == END){

endPoint = data;

finish = true;

break;

}

if(e!=SPACE){

continue;

}

//扩展后的点若在开表终则更新g值

PointData tempData = openList.Find((x=>{return x.point.Equals(newPoint);}));

if(tempData!=null){

}

}

}

}

[展开全文]
gaoziYY · 2020-01-25 · 0

if(){

float goffset;

if(Math.Abs(direction[i,0])+Math.Abs(direction[i,1]>1){

goffset = 1.4f;

}else{

goffset = 1;

}

if(tempData.g>data.g+goffset)

{

tempData.g = data.g + goffset;

tempData.parent = data;

}else{

goffset = 1.4f;

}else{

goffset = 1;

}

double h = HFun(newPoint);

PointData newData = new PointData(newPoint,data.g+goffset,h,data)

openList.Add(newData);

for()

[展开全文]
gaoziYY · 2020-01-25 · 0