private static void GetSpawnManager(){
			instance=(SpawnManager)FindObjectOfType(typeof(SpawnManager));

			if(instance!=null){
				window.waveFoldList=new List<bool>();
				for(int i=0; i<instance.waveList.Count; i++) window.waveFoldList.Add(true);
				
				//if path is empty, get a path
				if(instance.defaultPath==null) instance.defaultPath=(PathTD)FindObjectOfType(typeof(PathTD));
				
				//verify and setup the procedural wave generation unit list
				List<ProceduralUnitSetting> unitSettingList=instance.waveGenerator.unitSettingList;
				List<ProceduralUnitSetting> newSettingList=new List<ProceduralUnitSetting>();
				for(int i=0; i<creepList.Count; i++){
					bool match=false;
					for(int n=0; n<unitSettingList.Count; n++){
						if(unitSettingList[n].unit==creepList[i].gameObject){
							newSettingList.Add(unitSettingList[n]);
							match=true;
							break;
						}
					}
					if(!match){
						ProceduralUnitSetting unitSetting=new ProceduralUnitSetting();
						unitSetting.unit=creepList[i].gameObject;
						newSettingList.Add(unitSetting);
					}
				}
				instance.waveGenerator.unitSettingList=newSettingList;
				
				instance.waveGenerator.CheckPathList();
				if(instance.defaultPath!=null && instance.waveGenerator.pathList.Count==0)
					instance.waveGenerator.pathList.Add(instance.defaultPath);
				
				List<ProceduralVariable> rscSettingList=instance.waveGenerator.rscSettingList;
				while(rscList.Count>rscSettingList.Count) rscSettingList.Add(new ProceduralVariable(10, 500));
				while(rscList.Count<rscSettingList.Count) rscSettingList.RemoveAt(rscSettingList.Count-1);
				
				EditorUtility.SetDirty(instance);
			}
		}
		Vector2 DrawProceduralUnitSetting(float startX, float startY, ProceduralUnitSetting unitSetting){
			
			if(unitSetting.enabled) GUI.Box(new Rect(startX, startY, 185*4, 32+5*17+12), "");
			else GUI.Box(new Rect(startX, startY, 185*4, 32+10), "");
			
			startX+=5; 	startY+=5;
			
			Vector2 v2=default(Vector2);
			float cachedX=startX;
			
			int unitID=-1;
			for(int n=0; n<creepList.Count; n++){ if(unitSetting.unit==creepList[n].gameObject) unitID=n;	}
			EditorUtilities.DrawSprite(new Rect(startX, startY, 30, 30), creepList[unitID].iconSprite);
			
			EditorGUI.LabelField(new Rect(startX+32, startY+=-2, width, height), creepList[unitID].unitName);
			
			cont=new GUIContent("enabled: ", "Check to enable unit in the procedural generation otherwise unit will not be considered at all");
			EditorGUI.LabelField(new Rect(startX+32, startY+=spaceY-5, width, height), cont);
			unitSetting.enabled=EditorGUI.Toggle(new Rect(startX+32+60, startY, width, height), unitSetting.enabled);
			
			if(!unitSetting.enabled) return new Vector2(cachedX, startY);
			
			cont=new GUIContent("Min Wave:", "The minimum wave in which the creep will start appear in");
			EditorGUI.LabelField(new Rect(startX+=185, startY-8, width, height), cont);
			unitSetting.minWave=EditorGUI.IntField(new Rect(startX+70, startY-8, 40, height), unitSetting.minWave);
			
			EditorGUI.LabelField(new Rect(cachedX, startY+7, 185*4-10, height), "______________________________________________________________________________________________________________________");
			
			
			startY+=spaceY;
			startX=cachedX;
			
			
			cont=new GUIContent("HitPoint (HP):");
			v2=DrawProceduralVariable(startX, startY, unitSetting.HP, cont);			startX+=v2.x+20;
			
			cont=new GUIContent("Shield:");
			v2=DrawProceduralVariable(startX, startY, unitSetting.shield, cont);		startX+=v2.x+20;
			
			cont=new GUIContent("Move Speed:");
			v2=DrawProceduralVariable(startX, startY, unitSetting.speed, cont);	startX+=v2.x+20;
			
			cont=new GUIContent("Spawn Interval:");
			v2=DrawProceduralVariable(startX, startY, unitSetting.interval, cont);	startX+=v2.x+20;
				
			return v2;
		}