FMOD_Studio_EventDescription_GetInstanceList() private method

private FMOD_Studio_EventDescription_GetInstanceList ( IntPtr eventdescription, IntPtr array, int capacity, int &count ) : RESULT
eventdescription System.IntPtr
array System.IntPtr
capacity int
count int
return RESULT
        public RESULT getInstanceList(out EventInstance[] array)
        {
            array = null;
            int    num;
            RESULT rESULT = EventDescription.FMOD_Studio_EventDescription_GetInstanceCount(this.rawPtr, out num);

            if (rESULT != RESULT.OK)
            {
                return(rESULT);
            }
            if (num == 0)
            {
                array = new EventInstance[0];
                return(rESULT);
            }
            IntPtr[] array2 = new IntPtr[num];
            int      num2;

            rESULT = EventDescription.FMOD_Studio_EventDescription_GetInstanceList(this.rawPtr, array2, num, out num2);
            if (rESULT != RESULT.OK)
            {
                return(rESULT);
            }
            if (num2 > num)
            {
                num2 = num;
            }
            array = new EventInstance[num2];
            for (int i = 0; i < num2; i++)
            {
                array[i] = new EventInstance(array2[i]);
            }
            return(RESULT.OK);
        }