- Home /
Question by
Grundadrakk · Jul 28, 2018 at 07:09 AM ·
selecting objects
Why is my list of selected units cleared after the first time
I loose all objects after the first selection with alpha kes. The first time i can save my list with
private void ComputeKeySave()
{
if (Input.GetKey(KeyCode.LeftControl))
{
_key1 = new List<GameObject>(_selectedUnits);
}
}
but after selecting the units with
private void ComputeKeySelection()
{
ComputeKeySave();
if (Input.GetKeyDown(KeyCode.Alpha1))
{
_selectedUnits = _key1;
SetSelectorActivation(true);
}
}
i can select only one time, after deseelect my units, i lose all values in _key1 list
Comment