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

(197评价)
价格: 3000.00元

temp.AddComponent(type);

[展开全文]
Dragon · 2020-02-06 · 0

FindObjectofType<>获取场景中类对象

 

DontDestroyOnLoad(gameObject)不销毁对象

Destroy(gameObject)销毁游戏对象

[展开全文]
Dragon · 2020-02-06 · 0

单例一般要用 C# class,mono可能会有问题

[展开全文]
Dragon · 2020-02-06 · 0

Image 的Raycast Target属性不需要检测射线就设置成false

[展开全文]
Dragon · 2020-02-06 · 0

添加Editor文件夹u3d打包会不打包这个文件夹里的内容

 

AssetPostprocessor负责资源导入操作

 

TextureImporter importer = (TextureImporter) assetImporter;

importer.textureType = TextureImporterType.Sprite;

//导入图片资源自动为精灵类型

[展开全文]
Dragon · 2020-02-06 · 0

Read/Write Enabled true会加大内存在用量

Generate Mip Maps true会自动生成低像素图片,3d游戏中会有好处,2d游戏不建议使用,打包会出现图片模糊的现象

[展开全文]
Dragon · 2020-02-06 · 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

学到这里时,已按FSM和MVC架构,实现所有游戏逻辑。

[展开全文]
高伟程 · 2020-02-01 · 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

英语发音稍微有点迷哈哈哈,sderp笑死我了

[展开全文]
Ark_ · 2020-01-28 · 0

没看之前,单独写出来了

[展开全文]
高伟程 · 2020-01-28 · 0

AddTransition少写了return、;状态中act和Reson没调用。

[展开全文]
高伟程 · 2020-01-27 · 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