Esempio n. 1
0
    public void Utilities_InlinedArray_CanRemoveElementAtIndex(int count, int removeAt)
    {
        var comparisonList = new List <string>();
        var array          = new InlinedArray <string>();

        for (var i = 0; i < count; ++i)
        {
            comparisonList.Add(i.ToString());
            array.Append(i.ToString());
        }

        Assert.That(array.length, Is.EqualTo(comparisonList.Count));

        array.RemoveAt(removeAt);
        comparisonList.RemoveAt(removeAt);

        Assert.That(array, Is.EquivalentTo(comparisonList));
    }
        public void OnDisable()
        {
            int deviceIndex = GetDeviceEventIndex(m_Layout);

            if (deviceIndex != -1)
            {
                if (s_DeviceEventInfoArray[deviceIndex].firstControl.m_NextControlOnDevice == null)
                {
                    RemoveOnScreenDevice(deviceIndex);
                    s_DeviceEventInfoArray.RemoveAt(deviceIndex);
                }
                else
                {
                    // Not going to search entire list to match exact object.  Just remove head of list
                    // Unit we get to no other devices left.
                    s_DeviceEventInfoArray[deviceIndex].firstControl.m_NextControlOnDevice =
                        s_DeviceEventInfoArray[deviceIndex].firstControl.m_NextControlOnDevice.m_NextControlOnDevice;
                }
            }
        }