标签:
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=100; public bool isExplosion = false; //死亡并得分 public void ToDeadGetScore() { isExplosion = true; GameManager._instance.score += score; }
标签:
原文地址:http://www.cnblogs.com/fuperfun/p/5350830.html