20912人加入学习
(184人评价)
Unity2D 官方入门案例 - Ruby's Adventure

制作完成于2020年5月5日,基于Unity2019.3

价格 免费

预制体:Unity中的一种特殊资源,是一个或者一系列组件的集合体,可以使用预制体实例化克隆体,后续可对克隆体属性进行统一修改。

[展开全文]

静态方法与普通方法的区别解释得太好了,茅塞顿开

[展开全文]

Application.targetFrameRate=……可改变帧率

Ctrl+K+C可把选中部分的代码变为注释

Ctrl+K+U可把选中部分注释变为代码

[展开全文]

Ctrl+k+c=全部注释

Ctrl+k+=全部取消注释

 

[展开全文]

application.targetFrameRate =

更改游戏的帧率(update函数每秒调用次数)

[展开全文]

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class me : MonoBehaviour
{
    // Start is called before the first frame update
    void Start()
    {
        
    }

    // Update is called once per frame
    void Update()
    {
        float horizontal = Input.GetAxis("Horizontal");
        Debug.Log(horizontal);
        Vector2 pp = Transform.position;
          pp.x = pp.x + 01f;
        Transform.position = pp;
    }
}

[展开全文]

order in layer 渲染层级 数值小,先渲染,数值大,后渲染,后渲染的会覆盖先渲染的

[展开全文]

tilemap 可以使用笔刷和橡皮擦工具直接绘制地图

调出调色板 window->2d->tile palette

 

[展开全文]

用tilemap前在mainscene创建tile  2d->tilemap

setting->Grid and Snap Settings->Increment Snap->move 更改固定移动长度,可以根据图片大小更改,复制同样的材质进行移动无缝拼接

[展开全文]

Horizontal Axis 水平轴向

Vertical Axis 垂直轴向

Depth 深度轴向

[展开全文]

private Rigidbody2D rigidbody2D;

 

 

[展开全文]