void DrawStatement(GUIStatement statement, int dialogIndex, int questionIndex = -1, bool isQuestion = false) { GUI.BeginGroup(statement.StatementGroupRect); GUI.Box(statement.StatementBGRect, ""); GUI.Label(statement.StatementTitleRect, statement.StatementTitle, labelStyle); if (GUI.Button(statement.AddKeyWordBtn, "Add Keyword")) { AddKeyword(dialogIndex, questionIndex, isQuestion); } // draw keywords for (int j = 0; j < statement.keywords.Count; j++) { GUI.Label(statement.KeyWordsLabels[j], "Keyword: ", labelStyle); statement.keywords[j] = GUI.TextField(statement.KeyWordsInput[j], statement.keywords[j]); if (GUI.Button(statement.DeleteKeywordBtn[j], "X")) { DeleteKeyword(dialogIndex, questionIndex, j, isQuestion); } } GUI.Label(statement.TextLabelRect, "Text: ", labelStyle); statement.text = GUI.TextField(statement.TextInputRect, statement.text); GUI.Label(statement.ShortTextLabelRect, "Short Text: ", labelStyle); statement.shortText = GUI.TextField(statement.ShortTextInputRect, statement.shortText); GUI.EndGroup(); // end of starting statement }
void AddIntution(int pTimeState, int pChoiceIndex) { GUIStatement intutionStatement = new GUIStatement(); intutionStatement.enablingKeywords.Add(""); guiAccusationList[pTimeState].AccusationChoice[pChoiceIndex].investigatorIntution.Add(intutionStatement); SyncData(); CalculateRect(); }
public GUIAccusationStatementPair() { EnablingKeywords = new List <Keyword>(); EnablingKeywordsLabelList = new List <Rect>(); EnablingKeywordsInputList = new List <Rect>(); RemoveEnablingKeyword = new List <Rect>(); question = new GUIStatement(); answer = new GUIStatement(); }
GUIStatement GenerateStatement(Statement pStatement, Rect offsetRect, Rect ParentGroup, string title = "Starting Statement") { GUIStatement statement = new GUIStatement(); statement.StatementGroupRect = new Rect(20, offsetRect.y + offsetRect.height, ParentGroup.width - 40, 100); statement.StatementTitleRect = new Rect(10, 0, statement.StatementBGRect.width, 40); statement.StatementTitle = title; statement.AddKeyWordBtn = new Rect(statement.StatementGroupRect.width - 155, 10, 150, 30); statement.height = statement.StatementTitleRect.y + statement.StatementTitleRect.height; Rect prevRect = new Rect(0, 0, 0, statement.StatementTitleRect.y + statement.StatementTitleRect.height); foreach (Keyword keyword in pStatement.containedKeywords) { statement.keywords.Add(keyword.text); Rect statementRectLabel = new Rect(10, prevRect.y + prevRect.height + 5, 100, 20); Rect statementRectInput = new Rect(statementRectLabel.x + statementRectLabel.width, prevRect.y + prevRect.height + 5, statement.StatementGroupRect.width - (statementRectLabel.x + statementRectLabel.width) - 40, 20); Rect deleteBtn = new Rect(statementRectInput.x + statementRectInput.width + 10, statementRectInput.y, 20, 20); statement.KeyWordsLabels.Add(statementRectLabel); statement.KeyWordsInput.Add(statementRectInput); statement.DeleteKeywordBtn.Add(deleteBtn); prevRect = statementRectLabel; statement.height += statementRectLabel.height + 5; } statement.TextLabelRect = new Rect(10, prevRect.y + prevRect.height + 5, 100, 20); statement.TextInputRect = new Rect(statement.TextLabelRect.x + statement.TextLabelRect.width, statement.TextLabelRect.y, statement.StatementGroupRect.width - (statement.TextLabelRect.x + statement.TextLabelRect.width) - 10, 20); statement.text = pStatement.displayText; statement.ShortTextLabelRect = new Rect(10, statement.TextLabelRect.y + statement.TextLabelRect.height + 5, 100, 20); statement.ShortTextInputRect = new Rect(statement.ShortTextLabelRect.x + statement.ShortTextLabelRect.width, statement.ShortTextLabelRect.y, statement.TextInputRect.width, 20); statement.shortText = pStatement.shortenedText; statement.height += (statement.TextLabelRect.height + 5); statement.height += (statement.ShortTextLabelRect.height + 5); statement.StatementGroupRect.height = statement.height + 5; statement.StatementBGRect = new Rect(0, 0, statement.StatementGroupRect.width, statement.StatementGroupRect.height); return(statement); }
void DrawStatement(GUIStatement guiStatement, int accusationIndex, int choiceIndex = -1, int investigatorIntutionIndex = -1, int accusationDialogIndex = -1, bool isAccusationStatement = false, bool isRemoveable = false, string buttonStr = "Remove") { GUI.BeginGroup(guiStatement.StatementGroupRect); GUI.Box(guiStatement.StatementBGRect, ""); GUI.Label(guiStatement.StatementTitleRect, guiStatement.StatementTitle, labelStyle); if (GUI.Button(guiStatement.AddKeyWordBtn, "Add Keyword")) { AddKeyword(accusationIndex, choiceIndex, investigatorIntutionIndex, accusationDialogIndex, isAccusationStatement); } if (isRemoveable) { if (GUI.Button(guiStatement.RemoveStatement, buttonStr)) { DeleteStatement(accusationIndex, choiceIndex, investigatorIntutionIndex); } } // draw enabling keywords for (int j = 0; j < guiStatement.enablingKeywords.Count; j++) { GUI.Label(guiStatement.EnablingKeywordLabel[j], "Enabling Keyword: ", labelStyle); guiStatement.enablingKeywords[j] = GUI.TextField(guiStatement.EnablingKeywordInput[j], guiStatement.enablingKeywords[j]); } // draw keywords for (int j = 0; j < guiStatement.keywords.Count; j++) { GUI.Label(guiStatement.KeyWordsLabels[j], "Keyword: ", labelStyle); guiStatement.keywords[j] = GUI.TextField(guiStatement.KeyWordsInput[j], guiStatement.keywords[j]); if (GUI.Button(guiStatement.DeleteKeywordBtn[j], "X")) { DeleteKeyword(j, accusationIndex, choiceIndex, investigatorIntutionIndex, accusationDialogIndex, isAccusationStatement); } } GUI.Label(guiStatement.TextLabelRect, "Text: ", labelStyle); guiStatement.text = GUI.TextField(guiStatement.TextInputRect, guiStatement.text); GUI.Label(guiStatement.ShortTextLabelRect, "Short Text: ", labelStyle); guiStatement.shortText = GUI.TextField(guiStatement.ShortTextInputRect, guiStatement.shortText); GUI.EndGroup(); // end of starting statement }
public GUIDialog() { questions = new List <GUIQuestion>(); StartingStatement = new GUIStatement(); }
GUIStatement GenerateStatement(Statement pStatement, Rect offsetRect, Rect ParentGroup, string title = "Starting Statement") { GUIStatement guiStatement = new GUIStatement(); guiStatement.StatementGroupRect = new Rect(20, offsetRect.y + offsetRect.height, ParentGroup.width - 40, 100); guiStatement.StatementTitleRect = new Rect(10, 0, guiStatement.StatementBGRect.width, 40); guiStatement.StatementTitle = title; guiStatement.AddKeyWordBtn = new Rect(guiStatement.StatementGroupRect.width - 155, 10, 150, 30); guiStatement.RemoveStatement = new Rect(guiStatement.StatementGroupRect.width - 310, 10, 150, 30); guiStatement.height = guiStatement.StatementTitleRect.y + guiStatement.StatementTitleRect.height; Rect prevRect = new Rect(0, 0, 0, guiStatement.StatementTitleRect.y + guiStatement.StatementTitleRect.height); // enabling keyword if (pStatement.enablingKeyword != null) { guiStatement.enablingKeywords.Add(pStatement.enablingKeyword.text); Rect enablingKeywordLabelRect = new Rect(10, prevRect.y + prevRect.height + 5, 180, 20); Rect enablingKeywordInputRect = new Rect(enablingKeywordLabelRect.x + enablingKeywordLabelRect.width, enablingKeywordLabelRect.y, ParentGroup.width - enablingKeywordLabelRect.x - enablingKeywordLabelRect.width - 50, 20); guiStatement.EnablingKeywordLabel.Add(enablingKeywordLabelRect); guiStatement.EnablingKeywordInput.Add(enablingKeywordInputRect); prevRect = enablingKeywordLabelRect; } // keywords foreach (Keyword keyword in pStatement.containedKeywords) { guiStatement.keywords.Add(keyword.text); Rect statementRectLabel = new Rect(10, prevRect.y + prevRect.height + 5, 100, 20); Rect statementRectInput = new Rect(statementRectLabel.x + statementRectLabel.width, prevRect.y + prevRect.height + 5, guiStatement.StatementGroupRect.width - (statementRectLabel.x + statementRectLabel.width) - 40, 20); Rect deleteBtn = new Rect(statementRectInput.x + statementRectInput.width + 10, statementRectInput.y, 20, 20); guiStatement.KeyWordsLabels.Add(statementRectLabel); guiStatement.KeyWordsInput.Add(statementRectInput); guiStatement.DeleteKeywordBtn.Add(deleteBtn); prevRect = statementRectLabel; guiStatement.height += statementRectLabel.height + 5; } guiStatement.TextLabelRect = new Rect(10, prevRect.y + prevRect.height + 5, 100, 20); guiStatement.TextInputRect = new Rect(guiStatement.TextLabelRect.x + guiStatement.TextLabelRect.width, guiStatement.TextLabelRect.y, guiStatement.StatementGroupRect.width - (guiStatement.TextLabelRect.x + guiStatement.TextLabelRect.width) - 10, 20); guiStatement.text = pStatement.displayText; guiStatement.ShortTextLabelRect = new Rect(10, guiStatement.TextLabelRect.y + guiStatement.TextLabelRect.height + 5, 100, 20); guiStatement.ShortTextInputRect = new Rect(guiStatement.ShortTextLabelRect.x + guiStatement.ShortTextLabelRect.width, guiStatement.ShortTextLabelRect.y, guiStatement.TextInputRect.width, 20); guiStatement.shortText = pStatement.shortenedText; guiStatement.height += (guiStatement.TextLabelRect.height + 5); guiStatement.height += (guiStatement.ShortTextLabelRect.height + 5); guiStatement.StatementGroupRect.height = guiStatement.height + 5; guiStatement.StatementBGRect = new Rect(0, 0, guiStatement.StatementGroupRect.width, guiStatement.StatementGroupRect.height); return(guiStatement); }
void OnGUI() { GUI.Label(TitleLabel, "Accusation Tool", titleLabelStyle); if (GUI.Button(SaveBtn, "Save")) { SyncData(); SaveXMLFile(originalFileAddress); CalculateRect(); } for (int i = 0; i < guiAccusationList.Count; i++) { GUIAccusation guiAccusation = guiAccusationList[i]; scrollPosition = GUI.BeginScrollView(ScrollViewRect, scrollPosition, ScrollViewArea); GUI.BeginGroup(guiAccusation.AccusationGroup); GUI.Box(guiAccusation.AccusationBG, ""); GUI.Label(guiAccusation.AccusationTitle, "Accusation", dialogLabelStyle); GUI.Label(guiAccusation.TimeStampLabel, "Time Stamp: ", labelStyle); guiAccusation.timeState = System.Int32.Parse(GUI.TextField(guiAccusation.TimeStampInput, guiAccusation.timeState + "")); DrawStatement(guiAccusation.TransitionStatement, i); // drawing choices for (int choiceIndex = 0; choiceIndex < guiAccusation.AccusationChoice.Count; choiceIndex++) { GUIAccusationChoice guiAccusationChoice = guiAccusation.AccusationChoice[choiceIndex]; GUI.BeginGroup(guiAccusationChoice.accusationChoiceGroup); GUI.Box(guiAccusationChoice.accusationChoiceBG, ""); GUI.Label(guiAccusationChoice.choiceTitle, "Choice", dialogLabelStyle); if (GUI.Button(guiAccusationChoice.AddEnablingKeyword, "Add enabling keyword")) { AddKeyword(i, choiceIndex); } GUI.Label(guiAccusationChoice.PersonIDLabel, "Person ID: ", labelStyle); guiAccusationChoice.personID = System.Int32.Parse(GUI.TextField(guiAccusationChoice.PersonIDInput, guiAccusationChoice.personID + "")); GUI.Label(guiAccusationChoice.DefenderIDLabel, "Defender ID: ", labelStyle); guiAccusationChoice.defenderID = System.Int32.Parse(GUI.TextField(guiAccusationChoice.DefenderIDInput, guiAccusationChoice.defenderID + "")); for (int j = 0; j < guiAccusationChoice.enablingKeywords.Count; j++) { GUI.Label(guiAccusationChoice.EnablingKeywordsLabel[j], "Enabling keyword: ", labelStyle); guiAccusationChoice.enablingKeywords[j] = GUI.TextField(guiAccusationChoice.EnablingKeywordsInput[j], guiAccusationChoice.enablingKeywords[j]); if (GUI.Button(guiAccusationChoice.DeleteEnablingKeyword[j], "X")) { DeleteKeyword(j, i, choiceIndex); } } GUI.Label(guiAccusationChoice.InvestigatorIntutionTitle, "Investigator intuition statements:", dialogLabelStyle); if (GUI.Button(guiAccusationChoice.AddInvstigatorIntution, "Add intuition")) { AddIntution(i, choiceIndex); } for (int j = 0; j < guiAccusationChoice.investigatorIntution.Count; j++) { GUIStatement guiStatement = guiAccusationChoice.investigatorIntution[j]; DrawStatement(guiStatement, i, choiceIndex, j, -1, false, true, "Remove intuition"); } GUI.Label(guiAccusationChoice.AccusationStatementTitle, "Accusation dialogs:", dialogLabelStyle); if (GUI.Button(guiAccusationChoice.AddAccusationStatement, "Add accusation dialog")) { AddAccusationDialog(i, choiceIndex); } for (int j = 0; j < guiAccusationChoice.accusationStatement.Count; j++) { GUIAccusationStatementPair guiAccusationStatementPair = guiAccusationChoice.accusationStatement[j]; GUI.BeginGroup(guiAccusationStatementPair.AccusationStatementGroup); GUI.Box(guiAccusationStatementPair.AccusationStatementBGRect, ""); GUI.Label(guiAccusationStatementPair.titleRect, "Accusation dialog", labelStyle); if (GUI.Button(guiAccusationStatementPair.DeleteStatementPair, "Remove dialog")) { DeleteAccusationDialog(i, choiceIndex, j); } DrawStatement(guiAccusationStatementPair.question, i, choiceIndex, -1, j, true); DrawStatement(guiAccusationStatementPair.answer, i, choiceIndex, -1, j, false); GUI.EndGroup(); // end of accusation statement group } GUI.EndGroup(); // end of accusation choice group } GUI.EndGroup(); // end of accusation group GUI.EndScrollView(); } }
void CalculateRect() { guiAccusationList.Clear(); TitleLabel = new Rect(0, 0, screenX, 30); SaveBtn = new Rect(screenX - 155, 5, 150, 30); ScrollViewRect = new Rect(0, TitleLabel.height + 5, screenX, screenY - TitleLabel.height - 5); ScrollViewArea = new Rect(0, 0, screenX - 20, 0); Rect prevAccusationGroup = new Rect(5, 0, screenX - 25, 0); for (int i = 0; i < xmlAccusations.Count; i++) { Accusation accusation = (Accusation)xmlAccusations[i]; GUIAccusation guiAccusation = new GUIAccusation(); guiAccusation.timeState = (int)accusation.timeState; Rect accusationGroupRect = new Rect(prevAccusationGroup.x, prevAccusationGroup.y + prevAccusationGroup.height, prevAccusationGroup.width, 0); guiAccusation.AccusationGroup = accusationGroupRect; guiAccusation.AccusationBG = new Rect(0, 0, guiAccusation.AccusationGroup.width, guiAccusation.AccusationGroup.height); guiAccusation.AccusationTitle = new Rect(5, 5, 300, 30); guiAccusation.TimeStampLabel = new Rect(guiAccusation.AccusationTitle.x + guiAccusation.AccusationTitle.width, guiAccusation.AccusationTitle.y, 150, 20); guiAccusation.TimeStampInput = new Rect(guiAccusation.TimeStampLabel.x + guiAccusation.TimeStampLabel.width, guiAccusation.AccusationTitle.y, 150, 20); guiAccusation.TransitionStatement = GenerateStatement(accusation.transitionStatement, guiAccusation.AccusationTitle, guiAccusation.AccusationGroup, "Transition Statement"); Rect prevRect = guiAccusation.TransitionStatement.StatementGroupRect; ScrollViewArea.height += guiAccusation.AccusationTitle.height; ScrollViewArea.height += guiAccusation.TransitionStatement.StatementGroupRect.height; accusationGroupRect.height += guiAccusation.AccusationTitle.height; accusationGroupRect.height += guiAccusation.TransitionStatement.StatementGroupRect.height; for (int j = 0; j < accusation.choices.Count; j++) { AccusationChoice accusationChoice = (AccusationChoice)accusation.choices[j]; GUIAccusationChoice guiAccusationChoice = new GUIAccusationChoice(); guiAccusationChoice.personID = accusationChoice.personId; guiAccusationChoice.defenderID = accusationChoice.defenderId; Rect accusationChoiceGroup = new Rect(20, prevRect.y + prevRect.height + 10, guiAccusation.AccusationGroup.width - 40, 0); guiAccusationChoice.accusationChoiceGroup = accusationChoiceGroup; guiAccusationChoice.choiceTitle = new Rect(5, 5, 150, 30); guiAccusationChoice.AddEnablingKeyword = new Rect(accusationChoiceGroup.width - 155, guiAccusationChoice.choiceTitle.y / 2.0f, 150, 30); guiAccusationChoice.PersonIDLabel = new Rect(guiAccusationChoice.choiceTitle.x + guiAccusationChoice.choiceTitle.width, guiAccusationChoice.choiceTitle.y, 120, 20); guiAccusationChoice.PersonIDInput = new Rect(guiAccusationChoice.PersonIDLabel.x + guiAccusationChoice.PersonIDLabel.width, guiAccusationChoice.PersonIDLabel.y, 150, 20); //ScrollViewArea.height += 10; accusationGroupRect.height += guiAccusationChoice.choiceTitle.height; guiAccusationChoice.DefenderIDLabel = new Rect(guiAccusationChoice.PersonIDInput.x + guiAccusationChoice.PersonIDInput.width + 40, guiAccusationChoice.PersonIDInput.y, 120, 20); guiAccusationChoice.DefenderIDInput = new Rect(guiAccusationChoice.DefenderIDLabel.x + guiAccusationChoice.DefenderIDLabel.width, guiAccusationChoice.DefenderIDLabel.y, 150, 20); Rect tmpPrevRect = guiAccusationChoice.DefenderIDInput; for (int k = 0; k < accusationChoice.enablingKeywords.Count; k++) { guiAccusationChoice.enablingKeywords.Add(((Keyword)accusationChoice.enablingKeywords[k]).text); Rect enablingKeywordLabelRect = new Rect(10, guiAccusationChoice.DefenderIDLabel.y + guiAccusationChoice.DefenderIDLabel.height + k * 25 + 10, 180, 20); Rect enablingKeywordInputRect = new Rect(enablingKeywordLabelRect.x + enablingKeywordLabelRect.width, enablingKeywordLabelRect.y, guiAccusationChoice.accusationChoiceGroup.width - enablingKeywordLabelRect.x - enablingKeywordLabelRect.width - 5 - 30, enablingKeywordLabelRect.height); Rect deleteEnablingKeyword = new Rect(enablingKeywordInputRect.x + enablingKeywordInputRect.width + 5, enablingKeywordInputRect.y, 20, 20); //ScrollViewArea.height += enablingKeywordLabelRect.height + k * 25 + 10; accusationChoiceGroup.height += enablingKeywordLabelRect.height + k * 25 + 10; guiAccusationChoice.EnablingKeywordsLabel.Add(enablingKeywordLabelRect); guiAccusationChoice.EnablingKeywordsInput.Add(enablingKeywordInputRect); guiAccusationChoice.DeleteEnablingKeyword.Add(deleteEnablingKeyword); tmpPrevRect = enablingKeywordLabelRect; } guiAccusationChoice.InvestigatorIntutionTitle = new Rect(10, tmpPrevRect.y + tmpPrevRect.height + 10, 200, 20); tmpPrevRect = guiAccusationChoice.InvestigatorIntutionTitle; guiAccusationChoice.AddInvstigatorIntution = new Rect(accusationChoiceGroup.width - 155, guiAccusationChoice.InvestigatorIntutionTitle.y - 5, 150, 30); //ScrollViewArea.height += guiAccusationChoice.InvestigatorIntutionTitle.height + 10; accusationChoiceGroup.height += guiAccusationChoice.InvestigatorIntutionTitle.height + 10; for (int k = 0; k < accusationChoice.investigatorIntuitions.Count; k++) { Statement investigatorIntution = (Statement)accusationChoice.investigatorIntuitions[k]; tmpPrevRect.height += 10; GUIStatement guiInvestigatorIntution = GenerateStatement(investigatorIntution, tmpPrevRect, guiAccusationChoice.accusationChoiceGroup, "Investigator Intuitions"); tmpPrevRect = guiInvestigatorIntution.StatementGroupRect; //ScrollViewArea.height += guiInvestigatorIntution.StatementGroupRect.height; accusationChoiceGroup.height += guiInvestigatorIntution.StatementGroupRect.height; guiAccusationChoice.investigatorIntution.Add(guiInvestigatorIntution); } accusationChoiceGroup.height += 5; guiAccusationChoice.AccusationStatementTitle = new Rect(10, tmpPrevRect.y + tmpPrevRect.height, 200, 30); tmpPrevRect = guiAccusationChoice.AccusationStatementTitle; guiAccusationChoice.AddAccusationStatement = new Rect(accusationChoiceGroup.width - 155, guiAccusationChoice.AccusationStatementTitle.y + 3, 150, 30); //ScrollViewArea.height += guiAccusationChoice.AccusationStatementTitle.height; accusationChoiceGroup.height += guiAccusationChoice.AccusationStatementTitle.height; for (int k = 0; k < accusationChoice.statementPairs.Count; k++) { Question question = (Question)accusationChoice.statementPairs[k]; GUIAccusationStatementPair accusationStatementPair = new GUIAccusationStatementPair(); Rect accusationStatementGroup = new Rect(tmpPrevRect.x, tmpPrevRect.y + tmpPrevRect.height + 5, guiAccusationChoice.accusationChoiceGroup.width - tmpPrevRect.x - tmpPrevRect.x, 0); accusationStatementPair.titleRect = new Rect(10, 0, 150, 40); accusationStatementGroup.height += accusationStatementPair.titleRect.x + accusationStatementPair.titleRect.height; accusationStatementPair.DeleteStatementPair = new Rect(accusationStatementGroup.width - 155, 5, 150, 30); Rect offsetRect = accusationStatementPair.titleRect; accusationStatementPair.question = GenerateStatement(question.question, offsetRect, accusationStatementGroup, "AccusationStatement"); accusationStatementGroup.height += accusationStatementPair.question.StatementGroupRect.height; //ScrollViewArea.height += accusationStatementPair.question.StatementGroupRect.height; Rect questionTmpRect = new Rect(accusationStatementPair.question.StatementGroupRect); questionTmpRect.height += 5; accusationStatementPair.answer = GenerateStatement(question.answer, questionTmpRect, accusationStatementGroup, "ResultStatement"); accusationStatementGroup.height += accusationStatementPair.answer.StatementGroupRect.height; //ScrollViewArea.height += accusationStatementPair.answer.StatementGroupRect.height; guiAccusationChoice.accusationStatement.Add(accusationStatementPair); Rect accusationStatementBG = new Rect(0, 0, accusationStatementGroup.width, accusationStatementGroup.height); accusationStatementPair.AccusationStatementGroup = accusationStatementGroup; accusationStatementPair.AccusationStatementBGRect = accusationStatementBG; tmpPrevRect = accusationStatementGroup; //ScrollViewArea.height += accusationStatementPair.titleRect.height + 5; accusationChoiceGroup.height += accusationStatementPair.AccusationStatementGroup.height; } accusationChoiceGroup.height += 35; guiAccusationChoice.accusationChoiceGroup = accusationChoiceGroup; guiAccusationChoice.accusationChoiceBG = new Rect(0, 0, guiAccusationChoice.accusationChoiceGroup.width, guiAccusationChoice.accusationChoiceGroup.height); accusationGroupRect.height += guiAccusationChoice.accusationChoiceGroup.height; //accusationGroupRect.y = i * accusationGroupRect.height; prevRect = guiAccusationChoice.accusationChoiceGroup; guiAccusation.AccusationChoice.Add(guiAccusationChoice); } accusationGroupRect.height -= 200; guiAccusation.AccusationGroup = accusationGroupRect; guiAccusation.AccusationBG = new Rect(0, 0, guiAccusation.AccusationGroup.width, guiAccusation.AccusationGroup.height); ScrollViewArea.height += accusationGroupRect.height - 150; prevAccusationGroup.height += guiAccusation.AccusationGroup.height + 10; guiAccusationList.Add(guiAccusation); } ScrollViewArea.height += 20; }