得分的方法

using UnityEngine;
using System.Collections;

public class GameManager : MonoBehaviour
{

    public static GameManager _instance;
    public int score = 0;

    void Awake()
    {
        _instance = this;
    }

   
    
    // Update is called once per frame
    void Update () {
    
    }
}

在enemy脚本设置方法如下

public int score=100public bool isExplosion = false;
    //死亡并得分
    public void ToDeadGetScore()
    {
        isExplosion = true;
        GameManager._instance.score += score;
    }

 

posted @ 2016-04-03 21:37  礼桀  阅读(123)  评论(0)    收藏  举报