/// <summary>
    /// Sets the display
    /// </summary>
    /// <param name="player">The player to display</param>
    internal void SetValues(GenericInputHandler player)
    {
        TxtOverallScore.text  = player.GetPoints().ToString();
        TxtBonusScore.text    = "+" + player.GetBonusPoints().ToString();
        TxtOriginalScore.text = (player.GetPoints() - player.GetBonusPoints()).ToString();
        TxtName.text          = player.GetPlayerName();
        ImgPlayerImage.sprite = PlayerIcons[player.GetCharacterIndex()];
        ImgBackground.color   = ColourFetcher.GetColour(player.GetPlayerIndex());

        if (player.GetBonusPoints() == 0)
        {
            TxtBonusScore.text = "";
        }
    }
Ejemplo n.º 2
0
    /// <summary>
    /// Called when the object is created
    /// </summary>
    void Start()
    {
        DontDestroyOnLoad(this);

        // get the necessary components
        _device = PlayerInput.devices.FirstOrDefault();

        _activeHandler = GetComponent <LobbyInputHandler>();

        // work out which colour to assign to this player
        _colour = ColourFetcher.GetColour(PlayerInput.playerIndex);

        // display the player on UI
        UpdateMenu();

        // sets the colour on dualshock controls
        SetLightbarColour_();
    }
Ejemplo n.º 3
0
 /// <summary>
 /// Removes the current input handler and adds the specified type
 /// </summary>
 /// <param name="type">The type of handler to add</param>
 internal void SetActiveScript(Type type)
 {
     Destroy(gameObject.GetComponent <GenericInputHandler>());
     _activeHandler = (GenericInputHandler)gameObject.AddComponent(type);
 }