3765人加入学习
(18人评价)
Unity初级案例 - 炸弹人

Unity2018.4.7,制作完成于2020.12.27

价格 免费

private void OnDrawGizmos()

Gizmos.DrawLine(transform.position,transform.position+new Vector3(0,1,0)

layermask

.color = Color.red

[展开全文]

List<int>dirList = new List<int>();

dirList.Add(0);

int id = Random.Range(0, dirList.Count);

dirList[id]

CreateEnemy

 

[展开全文]

ontriggerEnter2D(Collider2D collision)

Physics2D.Raycast(transform.position,

[展开全文]

MovePosition(transform.position+)

switch(dir)

case 0;

default:

break;

Vector2 dirVector

Range(0, 4))

Move

 

[展开全文]

transform.position += new Vector3(h, v) * speed;

[展开全文]

GameController

Instantiate(playerPre,

Component

[展开全文]

Input.GetAxis("Horizontal")

Vertical

Animator anim;

anim=GetComponent<Animator>

Project Settings

Input

[展开全文]

int count=Random.Range(0,2+

Instantiate

[展开全文]

Unpack Prefab

private void CreateDoor()

int index=Random.Range(0,nullPointsList.coun

Instantiate()

 

 

[展开全文]

CreateWall

Instantiate()

GameObject wall = 

wallPre, transform

wall.transform.position=

Vector2 pos=

int index=Random.Range()

if (wallCount >= 

 

[展开全文]

FindNullPoints()

nullPointsList = new List<Vector2>();

Debug.log(.Count

[展开全文]

Scripts

MapController

InitMap

CreatSuperWall

GameObject superWallPre;

Instantiate(superWallPer,transform

GameObject wall = Instantiate(

wall.transform.position=newVecttor3(x,y)

 

[展开全文]

将project Settings里的time中的time scale变成0这样游戏就停止不能运行了。如:Time.timeScale = 0;

[展开全文]

foreach (var item in collection){}

[展开全文]

如果想要将2D的角色的上下顺序改变,只需要将Sprite Renderer下的Order in Layer

[展开全文]
落lllll · 2020-12-29 · 34-Door 0

授课教师

SiKi学院老师

课程特色

下载资料(1)
视频(66)