void Update() { if (Input.GetMouseButtonDown(0)) { if (EventSystem.current.IsPointerOverGameObject()) { return; } ray = Camera.main.ScreenPointToRay(new Vector3(Input.mousePosition.x, Input.mousePosition.y, 0)); int layer_mask = LayerMask.GetMask("Building"); if (Physics.Raycast(ray, out hit, Mathf.Infinity, layer_mask)) { if (hit.collider.tag == "Building") { Factory factory; if (hit.collider.gameObject.TryGetComponent <Factory>(out factory)) { factory.ShowInfo(); return; } Spaceport spaceport; if (hit.collider.gameObject.TryGetComponent <Spaceport>(out spaceport)) { spaceport.ShowInfo(); return; } Housing housing; if (hit.collider.gameObject.TryGetComponent <Housing>(out housing)) { HousingInfo.Show(housing); return; } } } } }
static Dictionary<string, object> getValue(HousingInfo hi) { Dictionary<string, object> data = new Dictionary<string, object>(); data["CasteId"] = hi.CasteId; data["ReligionId"] = hi.ReligionId; data["RoofMaterialTypeId"] = hi.RoofMaterialTypeId; data["NumberOfRoomsTypeId"] = hi.NumberOfRoomsTypeId; data["HouseOwnershipTypeId"] = hi.HouseOwnershipTypeId; data["LoanPurposeTypes"] = hi.LoanPurposeTypes; data["WaterSourceDistanceTypeId"] = hi.WaterSourceDistanceTypeId; data["WaterSourceTypes"] = hi.WaterSourceTypes; data["HasElectricity"] = hi.HasElectricity; data["HouseQualityTypeId"] = hi.HouseQualityTypeId; data["CookingEnergyTypeId"] = hi.CookingEnergyTypeId; data["ToiletTypeId"] = hi.ToiletTypeId; data["OrigEntryDate"] = FormatHelper.FormatOrigDate(hi.OrigEntryDate); return data; }
private void Awake() { Instance = this; this.gameObject.SetActive(false); }