1- //------------------------------------------------------------
2- // Game Framework
3- // Copyright © 2013-2021 Jiang Yin. All rights reserved.
4- // Homepage: https://gameframework.cn/
5- // Feedback: mailto:ellan@gameframework.cn
6- //------------------------------------------------------------
7-
8- using FairyGUI ;
9- using GameFrameX . UI . Runtime ;
10- using UnityEngine ;
11-
12- namespace GameFrameX . UI . FairyGUI . Runtime
13- {
14- /// <summary>
15- /// FairyGUI界面组辅助器。
16- /// </summary>
17- [ UnityEngine . Scripting . Preserve ]
18- public sealed class FairyGUIUIGroupHelper : UIGroupHelperBase
19- {
20- /// <summary>
21- /// 设置界面组深度。
22- /// </summary >
23- /// <param name=" depth">界面组深度。</param>
24- public override void SetDepth ( int depth )
25- {
26- transform . localPosition = new Vector3 ( 0 , 0 , depth * 100 ) ;
27- }
28-
29- public override IUIGroupHelper Handler ( Transform root , string groupName , string uiGroupHelperTypeName , IUIGroupHelper customUIGroupHelper )
30- {
31- GComponent component = new GComponent ( ) ;
32- GRoot . inst . AddChild ( component ) ;
33- var comName = groupName ;
34- component . displayObject . name = comName ;
35- component . gameObjectName = comName ;
36- component . name = comName ;
37- component . AddRelation ( GRoot . inst , RelationType . Width ) ;
38- component . AddRelation ( GRoot . inst , RelationType . Height ) ;
39- component . MakeFullScreen ( ) ;
40- return GameFrameX . Runtime . Helper . CreateHelper ( component . displayObject . gameObject , uiGroupHelperTypeName , ( UIGroupHelperBase ) customUIGroupHelper , 0 ) ;
41- }
42- }
1+ // GameFrameX 组织下的以及组织衍生的项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
2+ //
3+ // 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE 文件。
4+ //
5+ // 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
6+
7+ using FairyGUI ;
8+ using GameFrameX . UI . Runtime ;
9+ using UnityEngine ;
10+
11+ namespace GameFrameX . UI . FairyGUI . Runtime
12+ {
13+ /// <summary>
14+ /// FairyGUI界面组辅助器。
15+ /// </summary>
16+ [ UnityEngine . Scripting . Preserve ]
17+ public sealed class FairyGUIUIGroupHelper : UIGroupHelperBase
18+ {
19+ /// <summary>
20+ /// 设置界面组深度。
21+ /// </summary>
22+ /// <param name="depth">界面组深度。</param >
23+ public override void SetDepth ( int depth )
24+ {
25+ transform . localPosition = new Vector3 ( 0 , 0 , depth * 100 ) ;
26+ }
27+
28+ public override IUIGroupHelper Handler ( Transform root , string groupName , string uiGroupHelperTypeName , IUIGroupHelper customUIGroupHelper )
29+ {
30+ GComponent component = new GComponent ( ) ;
31+ GRoot . inst . AddChild ( component ) ;
32+ var comName = groupName ;
33+ component . displayObject . name = comName ;
34+ component . gameObjectName = comName ;
35+ component . name = comName ;
36+ component . opaque = false ;
37+ component . AddRelation ( GRoot . inst , RelationType . Width ) ;
38+ component . AddRelation ( GRoot . inst , RelationType . Height ) ;
39+ component . MakeFullScreen ( ) ;
40+ return GameFrameX . Runtime . Helper . CreateHelper ( component . displayObject . gameObject , uiGroupHelperTypeName , ( UIGroupHelperBase ) customUIGroupHelper , 0 ) ;
41+ }
42+ }
4343}
0 commit comments