Exemplo n.º 1
0
    // Update is called once per frame
    void Update()
    {
        if (gameState.CurrentState() == "Dialogue" && initiated != true)
        {
            if (gameState.GetInterlocutor() == characterName)
            {
                // Logic can be added here for which dialogue tree to start from
                Initialize();
                gameState.SetMusicState("Dialogue");

                if (gameState.GetArcState() == 2)
                {
                    Current = Reprimand1;
                    Current(-1);
                }
                else
                {
                    Current = Silence;
                    Current(-1);
                }
            }
        }
        if (gameState.CurrentState() == "Overworld" && initiated == true)
        {
            initiated = false;
        }
        if (initiated == true)
        {
            Current(GetChoice());
        }
    }
Exemplo n.º 2
0
    // Update is called once per frame
    void Update()
    {
        if (gameState.CurrentState() == "Dialogue" && initiated != true)
        {
            if (gameState.GetInterlocutor() == characterName)
            {
                // Logic can be added here for which dialogue tree to start from
                Initialize();
                gameState.SetMusicState("Dialogue");

                /* LOGIC GOES HERE! FOR NOW: GO TO THE ONLY DECISION */

                if (gameState.GetArcState() == 1)
                {
                    Current = Hello1;
                    Current(-1);
                }
                else if (gameState.GetArcState() == 2)
                {
                    Current = Appointment1;
                    Current(-1);
                }
            }
        }
        if (gameState.CurrentState() == "Overworld" && initiated == true)
        {
            initiated = false;
        }
        if (initiated == true)
        {
            Current(GetChoice());
        }
    }
Exemplo n.º 3
0
    // Update is called once per frame
    void Update()
    {
        if (gameState.CurrentState() == "Dialogue" && initiated != true)
        {
            if (gameState.GetInterlocutor() == characterName)
            {
                // Logic can be added here for which dialogue tree to start from
                Initialize();

                /* LOGIC GOES HERE! FOR NOW: GO TO THE ONLY DECISION */


                Current = Decision1;
                Current(-1);
            }
        }
        if (gameState.CurrentState() == "Overworld" && initiated == true)
        {
            initiated = false;
        }
        if (initiated == true)
        {
            Current(GetChoice());
        }
    }
Exemplo n.º 4
0
 // Update is called once per frame
 void Update()
 {
     if (gameState.CurrentState() == "Dialogue")
     {
         rigidBody.constraints = RigidbodyConstraints2D.FreezeAll;
     }
     else if (gameState.CurrentState() == "Overworld")
     {
         rigidBody.constraints = RigidbodyConstraints2D.FreezeRotation;
     }
 }
 // Update is called once per frame
 void Update()
 {
     if (gameState.CurrentState() == "Overworld")
     {
         transform.rotation = Quaternion.Euler(0, 0, 0);
     }
     else if (gameState.CurrentState() == "Dialogue")
     {
         transform.rotation = Quaternion.Euler(180, 0, 0);
     }
 }
 void OnGUI()
 {
     if (gameState.CurrentState() == "Dialogue")
     {
         GUI.Label(portraitRect, portrait, textStyle);
         GUI.Label(dialogue.rect, displayText, textStyle);
         if (!monologue)
         {
             if (finished)
             {
                 GUI.Label(choice1.rect, choice1.text, textStyle);
                 GUI.Label(choice2.rect, choice2.text, textStyle);
                 GUI.Label(choice3.rect, choice3.text, textStyle);
             }
         }
         else
         {
             // Center "..." where the choices would be
             if (finished)
             {
                 GUI.Label(new Rect(Screen.width / 2 - 25, Screen.height * 0.75f, 50, 20), "...", textStyle);
             }
         }
     }
 }
Exemplo n.º 7
0
    void PlayMusic(string currentState)
    {
        switch (currentState)
        {
        case "Dialogue":
            gameMusic.clip = music["FlushedTestSong1"];
            break;

        case "Overworld":
            gameMusic.clip = music["FlushedTestSong2"];
            break;

        case "Siren":
            gameMusic.clip = music["Siren"];
            gameMusic.loop = false;
            break;

        case "None":
            gameMusic.Stop();
            break;
        }
        //Debug.Log(gameMusic.clip);
        if (PlayOverworldMusic == false && gameState.CurrentState() == "Overworld")
        {
            gameMusic.Stop();
        }
        else
        {
            gameMusic.Play();
        }
    }
Exemplo n.º 8
0
    // Update is called once per frame
    void Update()
    {
        if (gameState.CurrentState() == "Dialogue" && initiated != true)
        {
            if (gameState.GetInterlocutor() == characterName)
            {
                // Logic can be added here for which dialogue tree to start from
                Initialize();
                if (gameState.GetArcState() < 2)
                {
                    gameState.SetMusicState("None");
                    Debug.Log("hello");
                }
                else if (gameState.GetArcState() >= 2)
                {
                    gameState.SetMusicState("Siren");
                }

                if (gameState.GetArcState() == 0)
                {
                    Current = Hello1;
                    Current(-1);
                }
                else if (gameState.GetArcState() == 2 || gameState.GetArcState() == 3)
                {
                    Current = Prognosis1;
                    Current(-1);
                }
                else
                {
                    Current = Silence;
                    Current(-1);
                }
            }
        }
        if (gameState.CurrentState() == "Overworld" && initiated == true)
        {
            initiated = false;
        }
        if (initiated == true)
        {
            Current(GetChoice());
        }
    }
Exemplo n.º 9
0
 // Update is called once per frame
 void Update()
 {
     //lerps the npc back and forth
     if (gameState.CurrentState() == "Overworld")
     {
         float distCovered = Mathf.PingPong((Time.time - startTime) * moveSpeed, 1);
         float fracJourney = (distCovered / travelDist * 2);
         transform.position = Vector2.Lerp(startPos, endPos, fracJourney);
     }
 }
Exemplo n.º 10
0
 // Update is called once per frame
 void Update()
 {
     //npc follows player if in range
     if (followingPlayer && !gameState.Safe() && gameState.CurrentState() == "Overworld" && !halt.isHalted())
     {
         float   step         = moveSpeed * Time.deltaTime;
         Vector2 moveToPlayer = Vector2.MoveTowards(transform.position, player.transform.position, step);
         transform.position        = moveToPlayer;
         circle.transform.position = moveToPlayer;
     }
 }