首页 > 其他 > 详细

噩梦 游戏结束 检测血量执行动画

时间:2015-07-28 21:18:09      阅读:283      评论:0      收藏:0      [点我收藏+]
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");
            }
        }
    }
}

版权声明:本文为博主原创文章,未经博主允许不得转载。

噩梦 游戏结束 检测血量执行动画

原文:http://blog.csdn.net/haifeng619/article/details/47109431

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!