示例#1
0
	void SetColliders()
	{
		meatMag = MeatStock.instance;

		SetDestinationCollider(); //destinationCol = destination.GetComponent<Collider2D> ();
		mainBaseCol = mainBase.GetComponent<Collider2D> ();
	}
示例#2
0
	void Awake () {
		if (playerInstantiator.Length == 0 || playerInstantiator.Length > 3) 
		{
			Debug.LogError ("Dupa");
			return;
		}


		if (instance == null) 
		{
			instance = this;
			return;
		}	
		Destroy (this);
	}
示例#3
0
	void Awake()
	{
        Invoke("TurnOnScreemer", waitingTime);

        audioSource = this.GetComponent<AudioSource>();

        meatStock = GameObject.FindObjectOfType<MeatStock>();

        victoryText.text = "";
		retryBtn.onClick.AddListener (RetryBtnAction);
		toMainMenu.onClick.AddListener (ContinoueAction);


		//humanCountText = this.GetComponent<Text> ();
		victoryPanel.SetActive (false);
		UpdatePlayer (0);
		playerHumansInstantiator.gameCondition = this;
		humansInstantiator = GameObject.FindObjectsOfType<HumanInstantiator> ();


        //botHumanInstantiator = new HumanInstantiator[humansInstantiator.Length];
		for (int i = 0; i< humansInstantiator.Length; i++) 
		{
			humansInstantiator[i].maxHumans = maxPopulation;

            if (humansInstantiator[i] != playerHumansInstantiator)
            {
                botHumanInstantiator.Add(humansInstantiator[i]);
            }

//			if(humansInstantiator[i].CompareTag(humansInstantiator))
//			{
//				playerHumansInstantiator = humansInstantiator[i];
//				playerHumansInstantiator.gameCondition = this;
//
//				Debug.Log("Ustawiam klase");
//			}

		}
	}