下面是一些USB摄像头的驱动(大多数摄像头都支持uvc标准): 1 使用软件库里的uvc-camera功能包 1.1 检查摄像头 lsusb ------------------------------------- 显示如下: Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 001 Device 007: ID 046d:082b Logitech, Inc. Webcam C170 Bus 001 Devi…
敌人生命系统(受伤 死亡) 敌人生成后有初始生命,被攻击受伤有打击特效,降低生命值,直至死亡: 死亡后怪物:播放死亡音效,动画,然后下沉地表,销毁:玩家:得到相应分数. 敌人生命脚本如下: 1.变量: public int startingHealth = 100; // 敌人初始生命 public int currentHealth; // 敌人当前生命 public float sinkSpeed = 2.5f; // 死亡后敌人下沉到地下的速度 public int scoreValue…
这里先补充一个得分管理器: 玩家得分设置成一个静态变量: public class ScoreManager : MonoBehaviour { public static int score; // 玩家得分 Text text; // UI void Awake () { text = GetComponent <Text> (); //开始时候重置得分 score = 0; } void Update () { // Set the displayed text to be the wo…