Exemple #1
0
    /// <summary>
    /// Displays the GUI for the player.
    /// Creates:
    ///     Prev and Next Buttons.
    ///     Stat Screen and Preview Screen.
    /// </summary>
    void OnGUI()
    {
        style          = new GUIStyle("TextArea");
        style.richText = true;

        /*if (GUI.Button (new Rect (10, 100, 100, 30), "Save")) {
         *              Game_Controller.controller.Save();
         *      }
         *      if (GUI.Button (new Rect (10, 140, 100, 30), "Load")) {
         *              Game_Controller.controller.Save();
         *      }*/
        if (GUI.Button(new Rect(10, Screen.height - 160, 50, 30), "Prev"))
        {
            Game_Controller.controller.curr_scenario.Prev_Player();
        }
        if (GUI.Button(new Rect(70, Screen.height - 160, 50, 30), "Next"))
        {
            Game_Controller.controller.curr_scenario.Next_Player();
        }

        //print (controller.curr_scenario.curr_player.GetComponent<Character_Script> ().character_name);
        if (controller.curr_scenario.curr_player.Count > 0)
        {
            if (!curr_player.Equals(controller.curr_scenario.curr_player.Peek().GetComponent <Character_Script>()))
            {
                curr_player = controller.curr_scenario.curr_player.Peek().GetComponent <Character_Script>();
                Update_Turn_Order();
            }

            //Debug.Log("Current player " + curr_player.name + " action count " + curr_player.curr_action.Count);
            if (curr_player.curr_action.Count > 0)
            {
                //Debug.Log(curr_player.curr_action.Peek().name);
                Current_Character_Preview();
            }
        }

        Turn_Order_Preview();

        Current_Tile_Preview();

        if (controller.curr_scenario.selected_tile.GetComponent <Tile>() != null)
        {
            //Debug.Log("Selecting");
            Current_Target_Preview();
        }
    }
Exemple #2
0
    /// <summary>
    /// Change the current turn order string being held by the camera.
    /// </summary>
    public void Update_Turn_Order()
    {
        string text = "";

        foreach (GameObject obj in Game_Controller.controller.curr_scenario.turn_order)
        {
            Character_Script chara = obj.GetComponent <Character_Script>();
            if (chara.Equals(curr_player))
            {
                text = text + "<color=red>" + chara.name + " " + chara.character_num + "</color> \n";
            }
            else
            {
                text = text + chara.name + " " + chara.character_num + "\n";
            }
        }
        turn_order = text;
    }