噩梦 游戏结束 检测血量执行动画
2015-07-28 18:34
507 查看
using UnityEngine;
namespace CompleteProject
{
public class GameOverManager : MonoBehaviour
{
public PlayerHealth playerHealth; // Reference to the player's health.
Animator anim; // Reference to the animator component.
void Awake ()
{
// Set up the reference.
anim = GetComponent <Animator> ();
}
void Update ()
{
// If the player has run out of health...
if(playerHealth.currentHealth <= 0)
{
// ... tell the animator the game is over.
anim.SetTrigger ("GameOver");
}
}
}
}
namespace CompleteProject
{
public class GameOverManager : MonoBehaviour
{
public PlayerHealth playerHealth; // Reference to the player's health.
Animator anim; // Reference to the animator component.
void Awake ()
{
// Set up the reference.
anim = GetComponent <Animator> ();
}
void Update ()
{
// If the player has run out of health...
if(playerHealth.currentHealth <= 0)
{
// ... tell the animator the game is over.
anim.SetTrigger ("GameOver");
}
}
}
}
相关文章推荐
- Extjs4.0 最新最全视频教程
- OpenERP 的XML-RPC的实例+many2many,one2many,many2one...
- CSS3属性教程与案例分享
- Kinect结合Unity3D引擎开发体感游戏(一)
- jquery教程靠边站,一分钱不花让你免费学会jquery
- autoit入门教程小结第1/5页
- 用Photoshop 制作草地效果简明教程
- 比较完整简洁的Flash处理XML文档数据教程 上篇第1/3页
- VBS基础编程教程 (第1篇)
- SQLite教程(十一):临时文件
- VBS基础编程教程 (第3篇)
- VBS教程:运算符-运算符(+)
- PostgreSQL教程(十):性能提升技巧
- PostgreSQL教程(二):模式Schema详解
- PostgreSQL教程(十三):数据库管理详解
- PostgreSQL教程(八):索引详解
- PostgreSQL教程(三):表的继承和分区表详解
- XML简易教程之三
- ruby 数组使用教程