예제 #1
0
 private void Awake()
 {
     if (PlantStats.instance == null)
     {
         instance = this;
     }
     else
     {
         Debug.Log("An instance of PlantStats already exists. Calling Destroy(gameObject) on the duplicate instance");
         Destroy(gameObject);
     }
 }
예제 #2
0
 void Awake()
 {
     instance = this;
 }
예제 #3
0
 // Use this for initialization
 void Start()
 {
     PS = GetComponent <PlantStats>();
 }