// Start is called before the first frame update
    void Start()
    {
        //display all contracts
        for (int i = 0; i < GameData.Instance.companies.Count; i++)
        {
            GameObject go = Instantiate(_contractPrefab, Vector3.zero, Quaternion.identity);
            go.transform.parent = _contractParent;
            Contract c = new Contract();
            go.transform.localScale = new Vector3(1, 1, 1);
            ContractButton cb = go.GetComponent <ContractButton>();
            cb.Init(c);
            int id = i;
            go.GetComponent <Button>().onClick.AddListener(delegate { ContractSelected(id); });
            _contractButtons.Add(cb);
        }


        SetNextPlayer();
    }
Beispiel #2
0
 public override void ViewDidLoad()
 {
     base.ViewDidLoad();
     // Perform any additional setup after loading the view, typically from a nib.
     ContractButton.SetCommand("TouchDown", Vm.ShowContractsCommand);
 }