private void Awake() { CanTakeDamage(true); networkHandler = GameObject.Find(PlayerPrefs.GetString("uniqueIdentity")).GetComponentInChildren <NetworkObjectHandler>(); stage1.SetActive(true); stage2.SetActive(false); stage3.SetActive(false); stage4.SetActive(false); }
void OnMouseDown() { SoundManager.PlaySplatSound(); GameObject ant = GetComponentInParent <AgentControl>().gameObject; NetworkObjectHandler networkHandler = GameObject.Find(PlayerPrefs.GetString("uniqueIdentity")).GetComponentInChildren <NetworkObjectHandler>(); networkHandler.TellServerToDestroyAnt(ant.gameObject); // 20 percent chance to drop ant egg float rand = Random.value; if (rand < 0.1f) { networkHandler.TellServerToSpawnAntEgg(ant.gameObject); } }