// Use this for initialization public void Initialise(Player battlebeard, Player stormshaper) { lastMousePos = new Vector2(Input.GetAxis("Mouse X"), Input.GetAxis("Mouse Y")); comparator = new CompareUnitUI(); battlebeardUIData = new List <UnitTypeUI>(); stormshaperUIData = new List <UnitTypeUI>(); BattlebeardUI.SetActive(false); StormshaperUI.SetActive(false); if (battlebeard != null) { GenerateUI(battlebeard); battlebeard.OnAddUnit += unitAdded; battlebeard.OnRemoveUnit += unitRemoved; battlebeard.OnUpdateUnit += unitUpdated; } if (stormshaper != null) { GenerateUI(stormshaper); stormshaper.OnAddUnit += unitAdded; stormshaper.OnRemoveUnit += unitRemoved; stormshaper.OnUpdateUnit += unitUpdated; } enabled = true; }
// Use this for initialization public void Initialise(Player battlebeard, Player stormshaper) { lastMousePos = new Vector2(Input.GetAxis("Mouse X"), Input.GetAxis("Mouse Y")); comparator = new CompareUnitUI(); battlebeardUIData = new List<UnitTypeUI>(); stormshaperUIData = new List<UnitTypeUI>(); BattlebeardUI.SetActive(false); StormshaperUI.SetActive(false); if (battlebeard != null) { GenerateUI(battlebeard); battlebeard.OnAddUnit += unitAdded; battlebeard.OnRemoveUnit += unitRemoved; battlebeard.OnUpdateUnit += unitUpdated; } if (stormshaper != null) { GenerateUI(stormshaper); stormshaper.OnAddUnit += unitAdded; stormshaper.OnRemoveUnit += unitRemoved; stormshaper.OnUpdateUnit += unitUpdated; } enabled = true; }