예제 #1
0
        protected void GoNextChapter(ScreenPlay choice = null)
        {
            ScreenPlay cc = CurrentChapter;

            if (choice == null)
            {
                CurrentChapter = NextChapterChoices[0];
            }
            else
            {
                foreach (ScreenPlay chapter in NextChapterChoices)
                {
                    if (chapter.Title == choice.Title)
                    {
                        CurrentChapter = chapter;
                        break;
                    }
                }
            }
            if (CurrentChapter == cc)
            {
                Debug.LogWarning("No new chapter was selected. Reverted to current chapter.");
            }
            if (CurrentChapter == null)
            {
                CurrentChapter = new GuildInterviewJin();  //TEMP replace with intro
                Debug.LogWarning("Current chapter null value. Reverted to default chapter.");
            }
        }
예제 #2
0
        void Update()
        {
            // TODO Implement auto forwarding when there is a command with no associated text.  There could be a wait time depending on the command.  For example, a background change with a transition might have a delay before forwarding, while a character entrance or exit might not need one, or it might need a shorter one.
            if (LineNumber >= CurrentChapter.Text.Count)
            {
                CurrentChapter = new GuildInterviewJin();
                LineNumber     = 0;
                Debug.LogWarning("Chapter restarted. Advancing to the next chapter not yet implemented.", this);
                //TODO signal the end of the chapter and call GoNextChapter();
            }

            // Check for changes to the window
            if (Screen.width != ScreenWidth)
            {
                ScreenWidth = Screen.width;
                Mover.ReSize((float)ScreenWidth);
                // TODO reposition characters based on the changed screen width
            }

            if (LineNumber == 0)
            {
                Debug.Log("Press spacebar to begin.");
            }

            // User input
            if (Input.GetKeyDown(KeyCode.Space))
            {
                ProcessLine();
            }

            // TODO Check for changes to the game state... such as ?
        }
예제 #3
0
        void Start()
        {
            CurrentChapter = new GuildInterviewJin();
            Backgrounds.Add(new BackgroundImage(BackgroundName.guildHall1));

            BPImageHook.color  = new Color(1f, 1f, 1f, a: 0.5f);
            BPImageHook.sprite = Resources.Load <Sprite>(Backgrounds[0].FilePath);
            // TODO factor out into separate method that sets the image and the color(alpha) in one call.
            // The call to set an image should happen in GameManager (Main), not SceneManager.  The functionality should be defined in backgroundimage.
        }
예제 #4
0
 public void SetUp(ScreenPlay currentChapter)
 {
     CharacterPanel = GameObject.Find("CharacterPanel").GetComponent <RectTransform>();
     CurrentChapter = currentChapter;
     Mover          = new Mover((float)Screen.width);
     Characters     = new List <Character>();
     LoadCharacters();
     // LoadCutScenes(); // If cutscenes are part of standardscene // cutscene and special cutscene? cutscene and cinematic?
     // TODO Destroy Mover when setup is complete.
 }
예제 #5
0
        void Awake()
        {
            // TODO Menus
            Menus = GameObject.FindGameObjectsWithTag(menu);

            // Instantiate the Scene Manager
            SceneManager = GameObject.Find("Managers").GetComponent <SceneManager>();

            // TEMP // TODO get the information from gamestate
            CurrentChapter = new CharacterTesting();
            // CurrentChapter = new GuildInterviewJin();
            // The awake call will happen on game start, right? so this should call the loading and title scenes (?)

            NextChapterChoices = new List <ScreenPlay>() // TEMP // TODO get the information from gamestate
            {
                { new GuildInterviewJin() }
            };
            SceneManager.SetUp(CurrentChapter);
            Characters = SceneManager.Characters;

            // Instantiate the Mover
            ScreenWidth = Screen.width;
            Mover       = new Mover((float)ScreenWidth);

            // Instantiate Text Manager
            SpeakerNameTextBox = GameObject.Find("SpeakerNameText").GetComponent <TextMeshProUGUI>();
            StoryTextBox       = GameObject.Find("StoryText").GetComponent <TextMeshProUGUI>();
            TextManager        = new TextManager(SpeakerNameTextBox, StoryTextBox);

            // Instantiate Background Manager
            BackgroundPanel   = GameObject.Find("BackgroundPanel");
            BackgroundManager = new BackgroundManager(BackgroundPanel);

            // Cashe the ThumbHook
            ThumbHook = GameObject.Find("SpeakerFace").GetComponent <Image>();
        }
예제 #6
0
 /////////////////////////////////////////////////////
 public void SetCurrentChapter(ScreenPlay chapter)
 {
     CurrentChapter = chapter;
 }
예제 #7
0
 void Awake()
 {
     CurrentChapter = null;
 }