public void InitializeBtnObjects() { BuildBtns = new Button[6]; btnTypesValues = System.Enum.GetValues(typeof(BtnTypes)) as BtnTypes[]; for(int i = 0; i < BuildBtns.Length; ++i) { btnSize.x = 150.0f * (i % 3); if(i > 2) { btnSize.y = 150.0f; } BuildBtns[i] = new Button(btnSize, checkMarkPos, (BtnTypes)(btnTypesValues.GetValue(i))); } buildBtnPosOffset = new Vector2((this.backgroundImg.width * 0.5f) - (this.buildBtnImg.width * 0.5f), BuildBtns[3].GetBtnArea().y + BuildBtns[3].GetBtnArea().height + 15.0f); buildBtn = new Button(); buildBtn.SetBtnArea(buildBtnPosOffset.x, buildBtnPosOffset.y, buildBtnImg.width, buildBtnImg.height); }