Exemple #1
0
    //Add stars from harvester.
    public void SpawnStars(int Amount)
    {
        if (!starInv)
        {
            starInv = GameObject.FindObjectOfType <StarInventory>();
        }

        starInv.AddStars(Amount);
    }
 // Use this for initialization
 void Start()
 {
     defenderParent = GameObject.Find("Defenders");
     if (!defenderParent)
     {
         defenderParent = new GameObject("Defenders");
     }
     starInv = GameObject.FindObjectOfType <StarInventory>();
 }
	void Awake () {
		if (theInstance == null) {
			DontDestroyOnLoad(gameObject);
			theInstance = this;
			starCheck = new bool[6];
		}
		else if (theInstance !=this){
			Destroy(gameObject);
		}
	}