0%

Debug.DrawLine

官方API说明

由于射线不可见, 所以测试时可以使用DrawLine绘制辅助线.
描述:在指定的起始点与结束点之间绘制一条直线

public static void DrawLine(
    Vector3 start, 
    Vector3 end
);

public static void DrawLine(
    Vector3 start, 
    Vector3 end, 
    Color color
);

public static void DrawLine(
    Vector3 start, 
    Vector3 end, 
    Color color, 
    float duration
);

public static void DrawLine(
    Vector3 start, 
    Vector3 end, 
    [Internal.DefaultValue("Color.white")] Color color, 
    [Internal.DefaultValue("0.0f")] float duration, 
    [Internal.DefaultValue("true")] bool depthTest
);
star世界空间中的点作为该直线的起始点
end世界空间中的点作为该直线的结束点
color该直线的颜色
duration该直线的可见长度应为多长
depthTest该直线是否应被靠近此摄像机的对象遮挡
阅读全文 »

Sprite

在2D项目中, Sprite是一个2D图形对象; 在3D项目中, Sprite是一个纹理对象.
官方说明

Sprite Creator(创建)

在项目中创建占位精灵

Sprite Editor(编辑)

允许从较大的图像中提取精灵图形, 并在图像编辑器中编辑单个纹理内的多个分量图像.

Sprite Renderer(渲染)

应使用Sprite Renderer组件而不是用于3D对象Mesh Renderer来渲染精灵. 使用该组件可将图像显示为精灵, 以便在2D和3D场景中均可使用.

Sprite Packer

根据项目来优化视频内存的使用和性能

阅读全文 »

准备工作

环境介绍

PXE服务器客户端
IP: 192.168.139.200
GATEWAY: 192.168.139.2
Image: deepin-desktop-community-1002-amd64.iso

添加软件源

1
2
sudo echo "deb [by-hash=force] https://professional-packages.chinauos.com/desktop-professional eagle main contrib non-free" >> /etc/apt/sources.list
sudo apt-get update

配置NFS

1
2
3
4
5
sudo apt-get install nfs-kernel-server -y
echo '/var/nfs *(rw,sync,no_subtree_check)' | sudo tee -a /etc/exports
sudo mkdir /var/nfs
sudo systemctl restart nfs-kernel-server
showmount -e localhost

挂载镜像, 并复制所有文件到NFS共享目录.

1
2
3
4
sudo mount deepin-desktop-community-1002-amd64.iso /mnt/
sudo mkdir -p /var/nfs/amd64
sudo cp -r /mnt/* /var/nfs/amd64/
sudo cp -r /mnt/.disk/ /var/nfs/amd64/
ls -lhA /mnt/
总用量 46714
drwxr-xr-x 1 user user 2.0K 9月   9  2020 boot
-rw-r--r-- 1 user user  16M 9月   3  2020 deepin-boot-maker.exe
-rw-r--r-- 1 user user  30M 9月   3  2020 deepin-boot-maker.zip
drwxr-xr-x 1 user user 2.0K 9月   9  2020 .disk
drwxr-xr-x 1 user user 2.0K 9月   9  2020 dists
drwxr-xr-x 1 user user 2.0K 9月   9  2020 EFI
drwxr-xr-x 1 user user 4.0K 9月   9  2020 isolinux
drwxr-xr-x 1 user user 2.0K 9月   9  2020 live
-rw-r--r-- 1 user user  41K 9月   9  2020 md5sum.txt
drwxr-xr-x 1 user user 2.0K 9月   9  2020 oem
drwxr-xr-x 1 user user 2.0K 9月   9  2020 pool
drwxr-xr-x 1 user user 2.0K 9月   9  2020 preseed

设置文件属主、属组和权限

1
2
sudo chown -R root:root /var/nfs/
find /var/nfs/amd64/ -type d -exec sudo chmod 755 {} \;

安装netboot-amd64, 并编写grub文件.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
sudo apt install debian-installer-10-netboot-amd64
sudo mkdir /var/tftp
sudo cp -r /lib/debian-installer/images/10/amd64/text/debian-installer /var/tftp/
sudo cat > /var/tftp/debian-installer/amd64/grub/grub.cfg <<-EOF
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray

insmod gzio
menuentry "Install Deepin V20" {
set gfxpayload=keep
linux /debian-installer/amd64/live/vmlinuz console=tty boot=live netboot=nfs nfsroot=192.168.139.200:/var/nfs/amd64/ components union=overlay locales=zh_CN. UTF-8 livecd-installer --
initrd /debian-installer/amd64/live/initrd.lz
}
EOF

将相关文件复制到关键目录

1
2
3
sudo mkdir /var/tftp/amd64
sudo cp -r /mnt/live /var/tftp/amd64
sudo cp /var/tftp/debian-installer/amd64/grubx64.efi /var/tftp/

配置dnsmasq

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
sudo apt install dnsmasq -y
sudo groupadd dnsmasq
sudo usermod -g dnsmasq dnsmasq
sudo chown dnsmasq:dnsmasq /var/tftp -R
sudo cat > /etc/dnsmasq.conf <<-EOF
listen-address=192.168.139.200
dhcp-boot=/debian-installer/amd64/bootnetx64.efi
interface=ens33
bind-interfaces
dhcp-range=192.168.139.50,192.168.139.150,1h
dhcp-option=3,192.168.139.2
dhcp-option=6,192.168.139.2
server=114.114.114.114
dhcp-option=28,192.168.139.255
dhcp-option=42,0.0.0.0
enable-tftp
tftp-root=/var/tftp
EOF
sudo systemctl restart dnsmasq