Пример #1
0
    private void OnAttackRollsInspected(object sender, EventArgs args)
    {
        AttackRollResultsView view = (AttackRollResultsView)sender;

        _unitTypeView.SetModel(view.GetModel().GetUnitType());
        _unitTypeView.gameObject.SetActive(true);
    }
Пример #2
0
    private void CreateAttackViewsForSide(GameObject[] spawnPoints)
    {
        bool areProcessingAttackers = spawnPoints == _attackerRollsSpawnPoints;

        if (_model.GetTotalUnitsQuantity(!areProcessingAttackers) > 0)
        {
            List <AttackRollResultsCollection> rolls = _model.GetAttackRollResults(areProcessingAttackers);
            int count = Mathf.Min(rolls.Count, spawnPoints.Length);

            for (int i = 0; i < count; i++)
            {
                AttackRollResultsView attackRollResultsView = (AttackRollResultsView)Instantiate(_attackRollResultsPrefab, spawnPoints[i].transform.position, Quaternion.identity);
                attackRollResultsView.transform.parent = spawnPoints[i].transform;
                attackRollResultsView.SetModel(rolls[i]);
                attackRollResultsView.MouseOver      += OnAttackRollsInspected;
                attackRollResultsView.MouseLeft      += OnUnitTypeInspectionEnded;
                _attackViews[rolls[i].GetUnitStack()] = attackRollResultsView;
            }
        }
    }