Пример #1
0
    private ContractConfig SelectFromContractConfigList(List <ContractConfig> contracts)
    {
        ContractConfig config = contracts[Random.Range(0, contracts.Count)];

        contracts.Remove(config);

        return(config);
    }
Пример #2
0
    private void DisplayContract(ContractConfig contract, int index)
    {
        ContractSelection newContractSelection = Instantiate(contractSelectionPrefab, gameObject.transform);

        newContractSelection.transform.localPosition
            = new Vector3(contractSelectXOffset, contractSelectYOffset - (index * contractSelectHeight));
        newContractSelection.SetContractConfig(contract);
    }
Пример #3
0
    private void DisplayAllContracts()
    {
        List <ContractConfig> availableContracts = new List <ContractConfig>(masterContractGate.GetContracts());

        if (availableContracts.Count < displayedContractCount)
        {
            displayedContractCount = availableContracts.Count;
        }

        for (int i = 0; i < displayedContractCount; i++)
        {
            ContractConfig contractConfig = SelectFromContractConfigList(availableContracts);
            DisplayContract(contractConfig, i);
        }
    }