示例#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>();
 }