First off, please use code tags as described here Using code tags properly as it is difficult to read code without formatting.
Second, could you please be more specific about what you need help with? You’ve just said vaguely that something is not adding a GameObject to an array. Which GameObject? Which Array? Which line of code is not producing the results you’re expecting? You’ve dumped a lot of code here.