/* * Launch or exit dragging mode */ public void ChangeDragging() { if (dragging) { Destroy(buildingSelected); dragging = false; gameUIManager.SetBuildingCreationMode(false); } else { gameUIManager.SetBuildingCreationMode(true); if (buildingChoice == null) { buildingChoice = GameObject.Find("Create Building Panel").GetComponent <BuildingChoice>(); } buildingSelected = Instantiate(buildingPrefabs[buildingChoice.GetChoice()], parentCity); buildingMaterial = buildingSelected.GetComponent <Renderer>().materials; buildingSize = buildingSelected.GetComponent <Collider>().bounds.size; buildingSelected.GetComponent <Renderer>().materials = new Material[] { nonPlacableMaterial, nonPlacableMaterial, nonPlacableMaterial, nonPlacableMaterial }; placable = false; buildingSelected.layer = 2; dragging = true; } }
public static void SetBuilding(this IDialogContext context, BuildingChoice value) { context.UserData.SetValue(Building, null == value ? null : JObject.FromObject(value).ToString()); }