// Use this for initialization void Awake() { var sm = FindObjectOfType <SceneSetupMan>(); if (sm == null) { Debug.Log("In MapMan.Awake Could not find object of type SceneSetupMan"); } sman = FindObjectOfType <SceneMan>(); var initscene = SceneMan.GetInitialSceneOption(); //Debug.Log("MapMan awake - now setting "+initscene); rmapgo = GameObject.Find("Map"); SetScene(initscene); qmap = true; old_qmap = !qmap; CreateQmap(); //Initialize(); }
public void InitVals() { if (sman == null) { LinkObjectsAndComponents(); } { var soopts = SceneMan.GetSceneOptionsList(); var soinival = SceneMan.GetInitialSceneOption().ToString(); var soidx = soopts.FindIndex(s => s == soinival); if (soidx <= 0) { soidx = 0; } initialScene.ClearOptions(); initialScene.AddOptions(soopts); initialScene.value = soidx; } { //var tropts = BuildingMan.GetTreeOptionsList(); //var trinival = BuildingMan.GetInitialTreeMode().ToString(); var tropts = bman.treeMode.GetOptionsAsList(); var trinival = bman.treeMode.Get().ToString(); var tridx = tropts.FindIndex(s => s == trinival); if (tridx <= 0) { tridx = 0; } treeOptions.ClearOptions(); treeOptions.AddOptions(tropts); treeOptions.value = tridx; } { //var blopts = BuildingMan.GetBldOptionsList(); //var trinival = BuildingMan.GetInitialBldMode().ToString(); var blopts = bman.bldMode.GetOptionsAsList(); var trinival = bman.bldMode.Get().ToString(); var blidx = blopts.FindIndex(s => s == trinival); if (blidx <= 0) { blidx = 0; } bldOptions.ClearOptions(); bldOptions.AddOptions(blopts); bldOptions.value = blidx; } { //var opts = LinkCloudCtrl.GetLvisOptionsList(); //var inival = LinkCloudCtrl.GetInitialLvisOption().ToString(); var opts = lman.lvisOptions.GetOptionsAsList(); var inival = lman.lvisOptions.Get().ToString(); //lman.SetLinkAndNodeVisibility(inival); // we should not have to do this var idx = opts.FindIndex(s => s == inival); if (idx <= 0) { idx = 0; } linkVisuals.ClearOptions(); linkVisuals.AddOptions(opts); linkVisuals.value = idx; } { linkTrans.minValue = lman.GetLinkTransMin(); linkTrans.maxValue = lman.GetLinkTransMax(); oldLinkTrans = lman.GetLinkTrans(); linkTrans.value = oldLinkTrans; } { var opts = gman.slotform.GetOptionsAsList(); var inival = gman.slotform.Get().ToString(); var idx = opts.FindIndex(s => s == inival); if (idx <= 0) { idx = 0; } slotVisuals.ClearOptions(); slotVisuals.AddOptions(opts); slotVisuals.value = idx; } { var opts = mman.mapVisiblity.GetOptionsAsList(); var inival = mman.mapVisiblity.Get().ToString(); var idx = opts.FindIndex(s => s == inival); if (idx <= 0) { idx = 0; } mapVisuals.ClearOptions(); mapVisuals.AddOptions(opts); mapVisuals.value = idx; } { var opts = vman.backType.GetOptionsAsList(); var inival = vman.backType.Get().ToString(); var idx = opts.FindIndex(s => s == inival); if (idx <= 0) { idx = 0; } backVisuals.ClearOptions(); backVisuals.AddOptions(opts); backVisuals.value = idx; } { var opts = vman.GetCameraOptions(); var inival = vman.mainCamName.Get().ToString(); var idx = opts.FindIndex(s => s == inival); if (idx <= 0) { idx = 0; } camSelection.ClearOptions(); camSelection.AddOptions(opts); camSelection.value = idx; } { var opts = lman.graphGenOptions.GetOptionsAsList(); var inival = lman.graphGenOptions.Get().ToString(); //Debug.Log("ggo inival:" + inival); var idx = opts.FindIndex(s => s == inival); if (idx <= 0) { idx = 0; } graphGenMode.ClearOptions(); graphGenMode.AddOptions(opts); graphGenMode.value = idx; } panelActive = true; }