public void Initialize(WeaponSlotElement owner)
    {
        _owner = owner;

        _dropDown.options = new List <Dropdown.OptionData>(AvailableParts.Select(x => new Dropdown.OptionData(x.name)));
        _dropDown.onValueChanged.AddListener(OnSelectionChanged);
    }
Beispiel #2
0
    private void Awake()
    {
        for (int i = 0; i < _weaponSlotCount.Value; i++)
        {
            WeaponSlotElement instance = Instantiate(_weaponSlotPrefab);
            instance.transform.SetParent(_parent);

            instance.Initialize(i);
        }
    }