# Examples

The following is a simple use of the above.

See the demo scenario StatTest in the example for more usage.

```
namespace RGame
{
    public class BtnOneParmModify : MonoBehaviour
    {
        public CommonStatRuntimeSO ValueSO;

        public string ValueName;
        public bool IsModifyMaxValue;
        public int ModifyValue;
        
        public FormulaCalSO FormulaSO;
        public string ParameterName;
        
        private Button mButton;

        private Dictionary<string, double> ParameterDic = new Dictionary<string, double>();

        private void Start()
        {
            mButton = GetComponent<Button>();
            
            mButton.onClick.AddListener(() =>
            {
                ParameterDic[ParameterName] = ModifyValue;
                ValueSO.ModifyValue(ValueName,FormulaSO.Evaluate(ValueSO,ParameterDic),IsModifyMaxValue);
            });
        }
    }
}
```

Mount the script and use it!

<figure><img src="https://2218703886-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4YPyrdOyfjDGtlxlvjSd%2Fuploads%2F3q9bw4jX6vEOqdiJe7dL%2F%E5%B1%8F%E5%B9%95%E6%88%AA%E5%9B%BE%202025-01-17%20180812.png?alt=media&#x26;token=2ae4cbce-46c1-453b-9e2d-6efa7ec84fad" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://roofen-game.gitbook.io/roofen-game/frameworks/common-stat/examples.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
