예제 #1
0
 // Update is called once per frame
 void Update()
 {
     anotherScript        = GetComponent <plantCollector>();
     myGameScore.text     = "Score : " + anotherScript.scoreOfGame;
     remainingPlants.text = "Plants :" + anotherScript.plantCount;
     remainingPanels.text = "Panels :" + anotherScript.panelCount;
 }
예제 #2
0
 private void OnTriggerEnter(Collider other)
 {
     if (other.gameObject.layer == 13)
     {
         plantCollector plantcollector = GetComponent <plantCollector>();
         plantcollector.scoreOfGame += 5;
         Destroy(other.gameObject);
     }
 }