涉及到物理位置变更时,一般都放在fixedupdate 里面
涉及到物理位置变更时,一般都放在fixedupdate 里面
update与fixedupdate的区别
public float speed
float x = Input.GetAxisRaw(''Horizontal'');
float y = Input.GetAxisRaw(''Vertical'');
Vector2 direction = new Vector2(x,y);
transform.Translate(direction*speed*Time.deltaTime);
CreateAssetMenu() 创建自定义菜单
public class ItemData :ScriptableObject 是一个可独立于类实例来保存大量数据的数据容器
1引入tilemap editor 瓦片编辑器
2打开瓦片编辑界面 Window -》2d-》Tile Palette
分层: