Ejemplo n.º 1
0
        public int Read(PlayerControl Player)
        {
            InputisHere = true;
            if (ThisWindow.ReturnHandler() && Reading)
            {
                Reading = false;
                ClearContent();
                HideWindow();
                Player.NotDoShomething();
                return(SelectionIndex);
            }
            else if (Input.GetKeyDown(KeyCode.Escape) && InputisHere && !NonEscapable)
            {
                Reading = false;
                ClearContent();
                HideWindow();
                Player.NotDoShomething();
                return(0);
            }
            else
            {
                Player.DoShomething();
                if (Input.GetKeyDown(KeyCode.W) || Input.GetKeyDown(KeyCode.UpArrow))
                {
                    if (SelectionIndex - 1 >= 1)
                    {
                        SelectionIndex--; SelectionPrompt.transform.position += new Vector3(0, 1, 0);
                    }
                    else if (SelectionIndex - 1 < 1)
                    {
                        SelectionIndex = Selections.Count; SelectionPrompt.transform.position += new Vector3(0, (Selections.Count * -1) + 1, 0);
                    }
                }

                if (Input.GetKeyDown(KeyCode.S) || Input.GetKeyDown(KeyCode.DownArrow))
                {
                    if (SelectionIndex + 1 <= Selections.Count)
                    {
                        SelectionIndex++; SelectionPrompt.transform.position += new Vector3(0, -1, 0);
                    }
                    else if (SelectionIndex + 1 > Selections.Count)
                    {
                        SelectionIndex = 1; SelectionPrompt.transform.position += new Vector3(0, (Selections.Count * 1) - 1, 0);
                    }
                }
            }

            return(0);
        }
 public void Read()
 {
     if (ThisWindow.ReturnHandler() && Reading && CanEscape)
     {
         if (RemainingCharactersCount == 0)
         {
             Message = string.Empty;
             Reading = false;
             ClearMessage();
             ClearContent();
             HideWindow();
         }
         else if (RemainingCharactersCount > 0)
         {
             ClearMessage();
             ClearContent();
             CreateCharacters();
         }
     }
 }
Ejemplo n.º 3
0
        public int ReadNoEscape()
        {
            if (ThisWindow.ReturnHandler() && Reading)
            {
                Reading = false;
                ClearContent();
                HideWindow();
                return(SelectionIndex);
            }
            else
            {
                if (Input.GetKeyDown(KeyCode.W) || Input.GetKeyDown(KeyCode.UpArrow))
                {
                    if (SelectionIndex - 1 >= 1)
                    {
                        SelectionIndex--; SelectionPrompt.transform.position += new Vector3(0, 1, 0);
                    }
                    else if (SelectionIndex - 1 < 1)
                    {
                        SelectionIndex = Selections.Count; SelectionPrompt.transform.position += new Vector3(0, (Selections.Count * -1) + 1, 0);
                    }
                }

                if (Input.GetKeyDown(KeyCode.S) || Input.GetKeyDown(KeyCode.DownArrow))
                {
                    if (SelectionIndex + 1 <= Selections.Count)
                    {
                        SelectionIndex++; SelectionPrompt.transform.position += new Vector3(0, -1, 0);
                    }
                    else if (SelectionIndex + 1 > Selections.Count)
                    {
                        SelectionIndex = 1; SelectionPrompt.transform.position += new Vector3(0, (Selections.Count * 1) - 1, 0);
                    }
                }
            }

            return(0);
        }