Skip to content

Commit 8d3dc1e

Browse files
AlianBlankclaude
andcommitted
docs: 补全 Quick Start 中的 UPM scopedRegistries 安装说明
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 4f0a6bb commit 8d3dc1e

5 files changed

Lines changed: 95 additions & 188 deletions

File tree

README.ja.md

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -31,33 +31,36 @@
3131

3232
## インストール
3333

34-
### 依存関係
34+
### インストール
35+
36+
Unity プロジェクトの `Packages/manifest.json` を編集し、`scopedRegistries` セクションを追加してください:
3537

3638
```json
3739
{
38-
"com.gameframex.unity": "1.1.1",
39-
"com.gameframex.unity.ui": "1.0.0",
40-
"com.gameframex.unity.asset": "1.0.6",
41-
"com.gameframex.unity.event": "1.0.0"
40+
"scopedRegistries": [
41+
{
42+
"name": "GameFrameX",
43+
"url": "https://gameframex.upm.alianblank.uk",
44+
"scopes": [
45+
"com.gameframex"
46+
]
47+
}
48+
]
4249
}
4350
```
4451

45-
### インストール方法(いずれかを選択)
52+
`scopes` は、どのパッケージをこのレジストリから解決するかを制御します。`com.gameframex` で始まるパッケージのみがこのレジストリから取得されます。
4653

47-
1. **Package Manager (推奨)**
48-
- Unity エディタを開く
49-
- Package Manager ウィンドウを開く
50-
- "+" ボタンをクリックし、「Add package from git URL」を選択
51-
- 入力: `https://github.com/gameframex/com.gameframex.unity.ui.ugui.git`
54+
Then add the package to `dependencies`:
5255

53-
2. **manifest.json**
54-
- `manifest.json` ファイルの `dependencies` セクションに追加
55-
```json
56-
{"com.gameframex.unity.ui.ugui": "https://github.com/gameframex/com.gameframex.unity.ui.ugui.git"}
57-
```
56+
```json
57+
{
58+
"dependencies": {
59+
"com.gameframex.unity.ui.ugui": "2.5.1"
60+
}
61+
}
62+
```
5863

59-
3. **ローカルインストール**
60-
- リポジトリをダウンロードして Unity プロジェクトの `Packages` ディレクトリに配置。自動検出されます。
6164

6265
## ライセンス
6366

README.ko.md

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -31,33 +31,36 @@
3131

3232
## 설치
3333

34-
### 종속성
34+
### 설치
35+
36+
Unity 프로젝트의 `Packages/manifest.json`을 편집하여 `scopedRegistries` 섹션을 추가하세요:
3537

3638
```json
3739
{
38-
"com.gameframex.unity": "1.1.1",
39-
"com.gameframex.unity.ui": "1.0.0",
40-
"com.gameframex.unity.asset": "1.0.6",
41-
"com.gameframex.unity.event": "1.0.0"
40+
"scopedRegistries": [
41+
{
42+
"name": "GameFrameX",
43+
"url": "https://gameframex.upm.alianblank.uk",
44+
"scopes": [
45+
"com.gameframex"
46+
]
47+
}
48+
]
4249
}
4350
```
4451

45-
### 설치 방법 (택 1)
52+
`scopes`는 이 레지스트리를 통해 어떤 패키지를 해석할지 제어합니다. `com.gameframex`로 시작하는 패키지만 이 레지스트리에서 가져옵니다.
4653

47-
1. **Package Manager (권장)**
48-
- Unity 에디터 열기
49-
- Package Manager 창 열기
50-
- "+" 버튼을 클릭하고 "Add package from git URL" 선택
51-
- 입력: `https://github.com/gameframex/com.gameframex.unity.ui.ugui.git`
54+
Then add the package to `dependencies`:
5255

53-
2. **manifest.json**
54-
- `manifest.json` 파일의 `dependencies` 섹션에 추가
55-
```json
56-
{"com.gameframex.unity.ui.ugui": "https://github.com/gameframex/com.gameframex.unity.ui.ugui.git"}
57-
```
56+
```json
57+
{
58+
"dependencies": {
59+
"com.gameframex.unity.ui.ugui": "2.5.1"
60+
}
61+
}
62+
```
5863

59-
3. **로컬 설치**
60-
- 저장소를 다운로드하여 Unity 프로젝트의 `Packages` 디렉토리에 배치. 자동 감지됩니다.
6164

6265
## 라이선스
6366

README.md

Lines changed: 16 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -81,87 +81,36 @@ All-in-One Solution for Indie Game Development · Empowering Indie Developers' D
8181

8282
## Quick Start
8383

84-
### 1. Basic UI Class Creation
84+
### Installation
8585

86-
```csharp
87-
using GameFrameX.UI.UGUI.Runtime;
88-
using UnityEngine;
86+
Edit your Unity project's `Packages/manifest.json` and add the `scopedRegistries` section:
8987

90-
public class MainMenuUI : UGUI
88+
```json
9189
{
92-
protected override void OnInit(object userData)
93-
{
94-
base.OnInit(userData);
95-
// Initialize UI logic
96-
}
97-
98-
protected override void OnOpen(object userData)
99-
{
100-
base.OnOpen(userData);
101-
// Logic when UI opens
102-
}
103-
104-
protected override void OnClose(bool isShutdown, object userData)
90+
"scopedRegistries": [
10591
{
106-
base.OnClose(isShutdown, userData);
107-
// Logic when UI closes
92+
"name": "GameFrameX",
93+
"url": "https://gameframex.upm.alianblank.uk",
94+
"scopes": [
95+
"com.gameframex"
96+
]
10897
}
98+
]
10999
}
110100
```
111101

112-
### 2. Using Extension Methods
102+
`scopes` controls which packages are resolved through this registry. Only packages whose names start with `com.gameframex` will be fetched from it.
113103

114-
```csharp
115-
using GameFrameX.UI.UGUI.Runtime;
116-
using UnityEngine.UI;
104+
Then add the package to `dependencies`:
117105

118-
public class UIController : MonoBehaviour
106+
```json
119107
{
120-
[SerializeField] private Button startButton;
121-
[SerializeField] private Image iconImage;
122-
[SerializeField] private RectTransform panel;
123-
124-
void Start()
125-
{
126-
// Button extension method
127-
startButton.onClick.Add(OnStartButtonClick);
128-
129-
// Image extension method
130-
iconImage.SetIcon("UI/Icons/StartIcon");
131-
132-
// RectTransform extension method
133-
panel.MakeFullScreen();
134-
}
135-
136-
private void OnStartButtonClick()
137-
{
138-
Debug.Log("Start button clicked!");
139-
}
108+
"dependencies": {
109+
"com.gameframex.unity.ui.ugui": "2.5.1"
110+
}
140111
}
141112
```
142113

143-
### 3. Using the Code Generator
144-
145-
1. Select a UGUI prefab in the Hierarchy
146-
2. Right-click and select `GameObject/UI/Generate UGUI Code`
147-
3. Code will be auto-generated in the `Assets/Hotfix/UI/UGUI/` directory
148-
149-
### 4. Using UIImage Component
150-
151-
```csharp
152-
using GameFrameX.UI.UGUI.Runtime;
153-
154-
public class IconDisplay : MonoBehaviour
155-
{
156-
[SerializeField] private UIImage iconImage;
157-
158-
void Start()
159-
{
160-
// Set icon with async loading support
161-
iconImage.icon = "UI/Icons/PlayerAvatar";
162-
}
163-
}
164-
```
165114

166115
## License
167116

README.zh-CN.md

Lines changed: 16 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -81,87 +81,36 @@
8181

8282
## 快速开始
8383

84-
### 1. 基本UI类创建
84+
### 安装
8585

86-
```csharp
87-
using GameFrameX.UI.UGUI.Runtime;
88-
using UnityEngine;
86+
编辑 Unity 项目的 `Packages/manifest.json`,添加 `scopedRegistries` 部分:
8987

90-
public class MainMenuUI : UGUI
88+
```json
9189
{
92-
protected override void OnInit(object userData)
93-
{
94-
base.OnInit(userData);
95-
// 初始化UI逻辑
96-
}
97-
98-
protected override void OnOpen(object userData)
99-
{
100-
base.OnOpen(userData);
101-
// UI打开时的逻辑
102-
}
103-
104-
protected override void OnClose(bool isShutdown, object userData)
90+
"scopedRegistries": [
10591
{
106-
base.OnClose(isShutdown, userData);
107-
// UI关闭时的逻辑
92+
"name": "GameFrameX",
93+
"url": "https://gameframex.upm.alianblank.uk",
94+
"scopes": [
95+
"com.gameframex"
96+
]
10897
}
98+
]
10999
}
110100
```
111101

112-
### 2. 使用扩展方法
102+
`scopes` 控制哪些包通过此注册表解析。只有以 `com.gameframex` 开头的包才会从这个注册表获取。
113103

114-
```csharp
115-
using GameFrameX.UI.UGUI.Runtime;
116-
using UnityEngine.UI;
104+
Then add the package to `dependencies`:
117105

118-
public class UIController : MonoBehaviour
106+
```json
119107
{
120-
[SerializeField] private Button startButton;
121-
[SerializeField] private Image iconImage;
122-
[SerializeField] private RectTransform panel;
123-
124-
void Start()
125-
{
126-
// 按钮扩展方法
127-
startButton.onClick.Add(OnStartButtonClick);
128-
129-
// 图片扩展方法
130-
iconImage.SetIcon("UI/Icons/StartIcon");
131-
132-
// RectTransform扩展方法
133-
panel.MakeFullScreen();
134-
}
135-
136-
private void OnStartButtonClick()
137-
{
138-
Debug.Log("Start button clicked!");
139-
}
108+
"dependencies": {
109+
"com.gameframex.unity.ui.ugui": "2.5.1"
110+
}
140111
}
141112
```
142113

143-
### 3. 使用代码生成器
144-
145-
1. 在Hierarchy中选择一个UGUI预制体
146-
2. 右键选择 `GameObject/UI/Generate UGUI Code(生成UGUI代码)`
147-
3. 代码将自动生成到 `Assets/Hotfix/UI/UGUI/` 目录下
148-
149-
### 4. 使用UIImage组件
150-
151-
```csharp
152-
using GameFrameX.UI.UGUI.Runtime;
153-
154-
public class IconDisplay : MonoBehaviour
155-
{
156-
[SerializeField] private UIImage iconImage;
157-
158-
void Start()
159-
{
160-
// 设置图标,支持异步加载
161-
iconImage.icon = "UI/Icons/PlayerAvatar";
162-
}
163-
}
164-
```
165114

166115
## 开源协议
167116

README.zh-TW.md

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -81,34 +81,37 @@
8181

8282
## 快速開始
8383

84-
### 1. 基本 UI 類創建
84+
### 安裝
8585

86-
```csharp
87-
using GameFrameX.UI.UGUI.Runtime;
88-
using UnityEngine;
86+
編輯 Unity 專案的 `Packages/manifest.json`,添加 `scopedRegistries` 部分:
8987

90-
public class MainMenuUI : UGUI
88+
```json
9189
{
92-
protected override void OnInit(object userData)
90+
"scopedRegistries": [
9391
{
94-
base.OnInit(userData);
95-
// 初始化 UI 邏輯
92+
"name": "GameFrameX",
93+
"url": "https://gameframex.upm.alianblank.uk",
94+
"scopes": [
95+
"com.gameframex"
96+
]
9697
}
98+
]
99+
}
100+
```
97101

98-
protected override void OnOpen(object userData)
99-
{
100-
base.OnOpen(userData);
101-
// UI 打開時的邏輯
102-
}
102+
`scopes` 控制哪些套件透過此註冊表解析。只有以 `com.gameframex` 開頭的套件才會從這個註冊表取得。
103103

104-
protected override void OnClose(bool isShutdown, object userData)
105-
{
106-
base.OnClose(isShutdown, userData);
107-
// UI 關閉時的邏輯
108-
}
104+
Then add the package to `dependencies`:
105+
106+
```json
107+
{
108+
"dependencies": {
109+
"com.gameframex.unity.ui.ugui": "2.5.1"
110+
}
109111
}
110112
```
111113

114+
112115
## 開源協議
113116

114117
詳見 [LICENSE.md](LICENSE.md) 檔案。

0 commit comments

Comments
 (0)