示例#1
0
 void Start()
 {
     if (FindObjectOfType <ScoreKeep>() != null)
     {
         ScoreKeep sk = FindObjectOfType <ScoreKeep>();
         ScoreAtLevel = sk.GetScore();
         MoneyAtLevel = sk.GetMoney();
         HpAtLevel    = sk.GetPlayerHP();
     }
 }
示例#2
0
 // Update is called once per frame
 void Update()
 {
     money = ScoreKeeper.GetMoney();
     if (selectedTurret >= 0)
     {
         if (Input.GetMouseButtonDown(0))
         {
             Debug.Log("Placing tower");
             PlaceTurret();
         }
     }
 }
示例#3
0
 // Start is called before the first frame update
 void Awake()
 {
     DontDestroyOnLoad(this.gameObject);
     gc       = FindObjectOfType <GameCanvas>();
     sk       = FindObjectOfType <ScoreKeep>();
     Money    = sk.GetMoney();
     Score    = sk.GetScore();
     playerHP = sk.GetPlayerHP();
     loadMe   = sk.lastLvl;
     Destroy(gc.gameObject);
     Destroy(sk.gameObject);
     gc = null;
     sk = null;
     SceneManager.LoadScene(loadMe);
 }