protected virtual void changeColor(MapManager.TypesOfMap t) { foreach (Material m in gameObject.GetComponent <Renderer>().materials) { m.color = new Color(0.8f, 0.8f, 0.8f); } if (t == MapManager.TypesOfMap.Original) { for (int i = 0; i < gameObject.GetComponent <Renderer>().materials.Length; i++) { Debug.Log(gameObject.GetComponent <Renderer>().materials.Length + "/" + originalColors.Count + "/" + i); gameObject.GetComponent <Renderer>().materials[i].color = originalColors[i]; } } else if (t == MapManager.TypesOfMap.Power && this is Power) { foreach (Material m in gameObject.GetComponent <Renderer>().materials) { m.color = new Color(0, 0.8f, 0); } } else if (t == MapManager.TypesOfMap.Water && this is Water) { foreach (Material m in gameObject.GetComponent <Renderer>().materials) { m.color = new Color(0, 0.8f, 0); } } }
public void showMapInfo(MapManager.TypesOfMap m) { if (m == MapManager.TypesOfMap.Original) { MapInfo.SetActive(false); return; } float prod = 0; float cons = 0; MapInfo.SetActive(true); if (m == MapManager.TypesOfMap.Water) { prod = GameManager.Instance.getResources()[0]; cons = GameManager.Instance.getResources()[1] + 1f; MapNameLabel.text = "Water"; ProductionLabel.text = "Production :" + prod + "MW/Day"; ConsumationLabel.text = "Consumation" + cons + "MW / Day"; } if (m == MapManager.TypesOfMap.Power) { prod = GameManager.Instance.getResources()[2]; cons = GameManager.Instance.getResources()[3] + 1f; ProductionLabel.text = "Production: " + prod + "m" + "\xB3" + "/Day"; ConsumationLabel.text = "Consumation: " + cons + "m" + "\xB3" + "/ Day"; MapNameLabel.text = "Power"; } if (prod / cons > 2) { IncomeBar.transform.localPosition = new Vector3(200, 8, 0); } else if (prod / cons < 0) { IncomeBar.transform.localPosition = new Vector3(0, 8, 0); } else { IncomeBar.transform.localPosition = new Vector3(((prod / cons)) * 100, 8, 0); } }
protected override void changeColor(MapManager.TypesOfMap t) { }