/* * Reset to try again */ public void ResetEmails() { // Set finished panel inactive donePanel.SetActive(false); lookAtFeedbackPanel.SetActive(false); // Move every mail to inbox foreach (Email mail in trash.GetEmails()) { // Add to inbox inbox.AddEmail(mail); } foreach (Email mail in archive.GetEmails()) { // Add to inbox inbox.AddEmail(mail); } // Clear other mailboxes trash.InitialiseEmailList(); archive.InitialiseEmailList(); // Set all emails inactive foreach (Email mail in inbox.GetEmails()) { mail.Reset(); } // Set current mailbox as inbox _currentMailbox = inbox; // Shuffle the list _currentMailbox.ShuffleEmails(); // Select current mailbox _currentMailbox.Select(); }
public void SetCurrentMailbox(MailboxScript newCurrentMailbox) { // Unselect currently selected email (otherwise it stays selected in the other mailbox) UnselectEmail(_currentlySelectedEmail); // Unselect mailbox _currentMailbox.Unselect(); // Keep the ref to the newly selceted mailbox _currentMailbox = newCurrentMailbox; // We don't have to call select as it's called in mailboxscript onclick() }
/* * Method called on initialisation */ private void Awake() { // Make the preview scrollview the correct height RectTransform rectTrans = previewScrollView.GetComponent <RectTransform>(); rectTrans.sizeDelta = new Vector2(rectTrans.sizeDelta.x, easyEmailPreviewArray[0].GetComponent <RectTransform>().rect.height *easyEmailPreviewArray.Length); // Set all emails inactive foreach (EmailPreviewScript preview in easyEmailPreviewArray) { preview.gameObject.SetActive(false); } foreach (EmailPreviewScript preview in mediumEmailPreviewArray) { preview.gameObject.SetActive(false); } foreach (EmailBodyScript body in easyEmailBodyArray) { body.gameObject.SetActive(false); } foreach (EmailBodyScript body in mediumEmailBodyArray) { body.gameObject.SetActive(false); } // Set the emailscript for all inboxes inbox.SetEmailScript(this); inbox.InitialiseEmailList(); archive.SetEmailScript(this); archive.InitialiseEmailList(); trash.SetEmailScript(this); trash.InitialiseEmailList(); // Set current mailbox as inbox _currentMailbox = inbox; // Set finished panel inactive donePanel.SetActive(false); lookAtFeedbackPanel.SetActive(false); // Initialise emails if (StaticClass.GetCurrentLevel() == 1) { InitialiseEasyEmails(); } else if (StaticClass.GetCurrentLevel() == 2) { InitialiseMediumEmails(); } // Shuffle the list _currentMailbox.ShuffleEmails(); // Select current mailbox _currentMailbox.Select(); }
/* * Set mailbox hovered on */ public void SetHoveredOn(MailboxScript mailboxHoveredOn) { _mailboxHoveredOn = mailboxHoveredOn; }