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

(196评价)
价格: 4019.00元

缺乏一个判定值会导致报错但不会有影响。

应该在判断X跟Y在正常范围值那段里再加上判断i与j是否在正常范围值,要不然在边缘的数字元素上按下鼠标中键会提示错误。

[展开全文]
PigKing · 2021-06-12 · 0

从这里开始,前面的准备工作差不多完成了,剩下的就是游戏逻辑的工作了。

[展开全文]
wang1130 · 2021-04-19 · 0

标记,到此还没做。。。

[展开全文]
wang1130 · 2021-04-19 · 0
public void RemoveFlag()
    {
        Transform flag = transform.Find("FlagElement");
        if (flag != null)
        {
            elementState = ElementState.Covered;
            flag.DOLocalMoveY(0.15f, 0.1f).onComplete += () =>
            {
                Destroy(flag.gameObject);
            };
        }
    }

使用DoTween做插旗拔旗的操作时,在完成时用Lambda表达式的方式去开启一个协程来销毁对象

[展开全文]
wang1130 · 2021-04-13 · 0

自己写出来了,性能感人。洪泛算一个周期要好几秒,沃日。原来是debug搞得鬼。

[展开全文]
高伟程 · 2020-04-13 · 0

这样用switch不好,当地图需要增加或减少元素时,你会改到哭的。

[展开全文]
高伟程 · 2020-04-12 · 0

这里我选择用一个数组保存下来trap的位置。

[展开全文]
高伟程 · 2020-04-12 · 0

这样写销毁方法不太好,应该当所有子物体都播放完粒子特效时,销毁整个物体。

[展开全文]
高伟程 · 2020-04-12 · 0

讲的太啰嗦了

[展开全文]
高伟程 · 2020-04-11 · 0

雷已经标记出来了,谁他妈会去踩。所以方块标记上雷时,不作处理。

[展开全文]
高伟程 · 2020-04-11 · 0

这里最好不要强转,用round比较好

[展开全文]
高伟程 · 2020-04-11 · 0

public void SwitchMuteState()

{

 

}

public void PlayClip(AudioClip clip)

[展开全文]
gaoziYY · 2020-02-04 · 0

public void LoadData()

{

lv = PlayerPrefs.GetInt("lv",1);

w = 20+(lv*3)

h = Random.Range(9,12);

}

public void SaveData()

{

 

}

[展开全文]
gaoziYY · 2020-02-03 · 0

public ToolType toolType;

private void OnMouseUp()

{

switch(toolType)[
case 

}

[展开全文]
gaoziYY · 2020-02-02 · 0

public void OnHoeSelected(bool isOn)

{

GameManager.Instance

}

[展开全文]
gaoziYY · 2020-02-02 · 0

public void OnLevelButtonClick(){

if(isHide == false){

isHide = true;;

GetComponent<RectTransform>().DOAnchorPosY(-7,0.5f);

}else{

isHide = false;

GetComponent<RectTransform>().DOAnchorPosY(45,0.5f);

}

}

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

dir = new Vector2Int(Mathf.Clamp)

[展开全文]
gaoziYY · 2020-01-31 · 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

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

private static double H(Point pnt)

{

return HManhattanDistance(pnt);

}

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