public void CreateFactory() { factory = (UnitFactory)BuildingsManager.instance.CreateBuilding(0); var colliders = factory.GetComponentsInChildren <SphereCollider>(); foreach (var c in colliders) { c.enabled = true; } factory.Init(1, factoryPosition); }