コード例 #1
0
    /// <summary>
    /// When a player possesses this pawn, we want to set the color of the game object to match their color
    /// </summary>
    /* Contributors: Scott Kauker */
    public override void OnPossessed()
    {
        NametagCreator nametag = GetComponent <NametagCreator>();

        nametag.SetText(Controller.Name);
        nametag.SetColor(Controller.PlayerColor);
    }
コード例 #2
0
    /// <summary>
    /// When a player possesses this pawn, we want to set the color of the game object to match their color
    /// </summary>
    /* Contributors: Scott Kauker */
    public override void OnPossessed()
    {
        sprite       = GetComponent <SpriteRenderer>();
        sprite.color = Controller.PlayerColor;

        nametag = GetComponent <NametagCreator>();
        nametag.SetText(Controller.Name);
        nametag.SetColor(Controller.PlayerColor);
    }