public void Start() { int i = 0; foreach (EColor color in config.colors) { var req = new CRequest(); req.color = color; req.gameObject = requiresObjects[i]; req.renderer = req.gameObject.GetComponent <SpriteRenderer>(); req.renderer.sprite = colors.GetCorrectSprite(color); req.Off(); requests.Add(req); ++i; } for (; i < requiresObjects.Length; ++i) { requiresObjects[i].SetActive(false); } CheckAvailable(); }