FairyGUI.UIPanel.CreateUI_PlayMode C# (CSharp) Method

CreateUI_PlayMode() public method

public CreateUI_PlayMode ( ) : void
return void
        void CreateUI_PlayMode()
        {
            _created = true;

            if (string.IsNullOrEmpty(packageName) || string.IsNullOrEmpty(componentName))
                return;

            _ui = (GComponent)UIPackage.CreateObject(packageName, componentName);
            if (_ui != null)
            {
                _ui.position = position;
                if (scale.x != 0 && scale.y != 0)
                    _ui.scale = scale;
                _ui.rotationX = rotation.x;
                _ui.rotationY = rotation.y;
                _ui.rotation = rotation.z;
                if (this.container.hitArea != null)
                {
                    UpdateHitArea();
                    _ui.onSizeChanged.Add(UpdateHitArea);
                    _ui.onPositionChanged.Add(UpdateHitArea);
                }
                this.container.AddChildAt(_ui.displayObject, 0);

                HandleScreenSizeChanged();
            }
            else
                Debug.LogError("Create " + componentName + "@" + packageName + " failed!");
        }