private BlockGoalItemView CreateBlockGoalItem(IBlockGoal blockGoal) { var blockGoalView = Instantiate(_blockGoalItemViewPrefab, _parentForGoal); blockGoalView.Init(blockGoal); return(blockGoalView); }
public void Init(IBlockGoal blockGoal) { _blockGoal = blockGoal; Subscribe(); SetAmountTextVisability(true); SetCompeteIconVisabilbity(false); _amount.text = _blockGoal.Amount.ToString(); _blockSprite.overrideSprite = GameElementSpriteHolder.GetBlockSprite(_blockGoal.Type); }
public void RemoveBlockGoal(IBlockGoal blockGoal) { var blockGoalItemView = _blockGoalItemViewList.Find(blockGoalView => blockGoalView.Type == blockGoal.Type); if (blockGoalItemView == null) { return; } _blockGoalItemViewList.Remove(blockGoalItemView); Destroy(blockGoalItemView.gameObject); }
private void RaiseBlockGoalAddedEvent(IBlockGoal blockGoal) { BlockGoalAddedEvent?.Invoke(blockGoal); }
private void OnBlockGoalRemovedHandler(IBlockGoal blockGoal) { _hudView.RemoveBlockGoal(blockGoal); }
private void OnBlockGoalAddedHandler(IBlockGoal blockGoal) { _hudView.AddBlockGoal(blockGoal); }
public void AddBlockGoal(IBlockGoal blockGoal) { var blockGoalViewItem = CreateBlockGoalItem(blockGoal); _blockGoalItemViewList.Add(blockGoalViewItem); }