Role.Description

From Intrigues Wiki
Revision as of 11:16, 5 January 2024 by Tayfunwiki (talk | contribs) (Created page with "=== Role Class - <code>Description</code> Property === ==== Overview ==== The <code>Description</code> property in the Role class provides a detailed explanation of a character's role within the game. ==== Syntax ==== <syntaxhighlight lang="c#"> [field: SerializeField] public string Description { get; private set; } </syntaxhighlight> ==== Description ==== This property conveys the responsibilities, significance, and general characteristics of a role. It's used to giv...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Role Class - Description Property

Overview

The Description property in the Role class provides a detailed explanation of a character's role within the game.

Syntax

[field: SerializeField] public string Description { get; private set; }

Description

This property conveys the responsibilities, significance, and general characteristics of a role. It's used to give players and developers a clear understanding of what a particular role entails.

Usage

Description is useful for game UI elements that need to provide more information about a character's role, and for in-game logic where the characteristics of a role need to be considered.

Example of Usage

public class RoleInfoDisplay : MonoBehaviour {
    void Start() {
        // Access the player's role
        var playerRole = IM.Player.Role;

        if (playerRole != null) {
            // Output the description of the player's role
            Debug.Log($"Role Description: {playerRole.Description}");
        }
    }
}

Remarks

  • This property is vital for giving context and background to roles, enhancing player immersion and understanding.
  • Can be used in various UI elements like tooltips, character sheets, or dialogue boxes to provide detailed information about a role.