public void SetRequairments(string _xmlDoc, ParseAll.WhatBlockParse _wbp) { GetRequeriments(blockId, _xmlDoc); foreach (var mm in rList) { foreach (var nn in MainResourcesController.buildingsLevel) { if (nn.Key == mm.strTech) { if (nn.Value >= mm.count_need) { reqText += "<color=#70B920>" + mm.strGood + " (" + mm.count_need + "),</color> "; requairmentsText.text = reqText; } else { reqText += "<color=#E91C4E>" + mm.strGood + " (" + mm.count_need + "),</color> "; requairmentsText.text = reqText; } } } foreach (var pp in MainResourcesController.technologyLevel) { if (pp.Key == mm.strTech) { if (pp.Value >= mm.count_need) { reqText += "<color=#70B920>" + mm.strGood + " (" + mm.count_need + "),</color> "; requairmentsText.text = reqText; } else { reqText += "<color=#E91C4E>" + mm.strGood + " (" + mm.count_need + "),</color> "; requairmentsText.text = reqText; } } } if (_wbp == ParseAll.WhatBlockParse.Technology) { gameObject.SetActive(true); } else { if (reqText.Contains("E91C4E")) { gameObject.SetActive(false); } else { gameObject.SetActive(true); } } } }
public void CheckPanel(int _whatBlock) { if (_whatBlock == (int)ParseAll.WhatBlockParse.Weapon) { whatBlock = ParseAll.WhatBlockParse.Weapon; headerDoc.SetActive(true); headerDef.SetActive(false); if (MainResourcesController.hangar != 0) { docPanel.SetActive(true); defPanel.SetActive(false); docDefErrorPanel.SetActive(false); } else { docDefErrorPanel.SetActive(true); docPanel.SetActive(false); defPanel.SetActive(false); } } else if (_whatBlock == (int)ParseAll.WhatBlockParse.Defence) { whatBlock = ParseAll.WhatBlockParse.Defence; headerDoc.SetActive(false); headerDef.SetActive(true); if (MainResourcesController.hangar != 0) { docPanel.SetActive(false); defPanel.SetActive(true); docDefErrorPanel.SetActive(false); } else { docDefErrorPanel.SetActive(true); docPanel.SetActive(false); defPanel.SetActive(false); } } }
public void SetBlockLevel(int _id, ParseAll.WhatBlockParse _wbp) { if (_wbp == ParseAll.WhatBlockParse.Builings || _wbp == ParseAll.WhatBlockParse.Technology) { foreach (var mm in MainResourcesController.buildingsLevel) { foreach (var nn in MainResourcesController.resDictionary) { if (nn.resId == _id) { if (nn.resTechName == mm.Key) { blockLevel = mm.Value; } } } } } if (_wbp == ParseAll.WhatBlockParse.Research || _wbp == ParseAll.WhatBlockParse.Technology) { foreach (var mm in MainResourcesController.technologyLevel) { foreach (var nn in MainResourcesController.resDictionary) { if (nn.resId == _id) { if (nn.resTechName == mm.Key) { blockLevel = mm.Value; } } } } } }