// Use this for initialization void Start() { //mySpawnerCollision = new SpawnerCollision(workerCost, worker, collectionZone, spawnDirection, this.GetComponent<Renderer>().material); mySpawnerCollision = this.gameObject.GetComponent <SpawnerCollision>(); mySpawnerCollision.SpawnerCollision_Rebuild(workerCost, worker, collectionZone, spawnDirection, this.GetComponent <Renderer>().material, allegiance); /* * mySpawnerCollision = this.gameObject.AddComponent<SpawnerCollision>(); * mySpawnerCollision.SpawnerCollision_Rebuild(workerCost, worker, collectionZone, spawnDirection, this.GetComponent<Renderer>().material); */ }
public void OneTimeSetUp() { mockCollectionZone = GameObject.Instantiate <GameObject>(Resources.Load <GameObject>("CollectionZone"), new Vector3(0, 0, 20), Quaternion.identity); mockSpawner = GameObject.Instantiate <GameObject>(Resources.Load <GameObject>("Spawner")); spawnerCollision = mockSpawner.AddComponent <SpawnerCollision>(); WorkerFactory.WorkerTemplate = Resources.Load <GameObject>("Worker"); WorkerFactory.Team1Material = Resources.Load <Material>("Materials/Team1"); WorkerFactory.Team2Material = Resources.Load <Material>("Materials/Team2"); WorkerFactory.DefaultMaterial = Resources.Load <Material>("Materials/Default"); GameResources.resourceDictionary = new Dictionary <GameResources.Allegiance, int>(); GameResources.resourceDictionary.Add(GameResources.Allegiance.Team1, 0); GameResources.resourceDictionary.Add(GameResources.Allegiance.Team2, 0); GameResources.Display = "Resources: "; GameResources.DisplayAlt = "Enemy: "; GameResources.countText = GameObject.Find("CountText").GetComponent <Text>(); GameResources.countTextAlt = GameObject.Find("EnemyCountText").GetComponent <Text>(); }