//Initializing
 public void Init()
 {
     if (this.m_isInit)
     {
         return;
     }
     EventBus.Subscribe(this);
     this.m_Tags       = this.gameObject.transform.Find("SequentialSelector").gameObject.GetComponent <CharBSequentialSelector>();
     this.m_Label      = this.gameObject.transform.Find("SequentialSelector").gameObject.GetComponent <CharBSequentialSelector>().m_Label;
     this.m_Label.text = Local["GUI_TagSelector_Label"];
     this.m_isInit     = true;
 }
        //Creating objects
        public static PortraitTagSelector CreateObject()
        {
            UICommon   uICommon      = Game.Instance.UI.Common;
            GameObject parentElement = uICommon?.transform.Find("CharacterBuild/Body/Content")?.gameObject;
            //TODO: remake to instantiate from Constitution instead
            GameObject      preFab      = uICommon?.transform.Find("CharacterBuild/Body/Content/RaceRightSide/Constitution")?.gameObject;
            TextMeshProUGUI labelPreFab = uICommon?.transform.Find("CharacterBuild/Body/Content/RaceRightSide/Constitution/LabelPlace/Label/LabelText").gameObject.GetComponent <TextMeshProUGUI>();

            if (!parentElement || !preFab || !labelPreFab)
            {
                return(null);
            }
            GameObject portraitTagSelectorCanvas = Instantiate(preFab, parentElement.transform, false);

            portraitTagSelectorCanvas.AddComponent <CanvasGroup>();
            portraitTagSelectorCanvas.transform.SetSiblingIndex(0);
            //Initialize transform
            Mod.Debug("Initialize transform");
            portraitTagSelectorCanvas.name = "PortraitTagSelector";
            RectTransform rectPortraitTagSelector = (RectTransform)portraitTagSelectorCanvas.transform;

            rectPortraitTagSelector.anchorMin = new Vector2(0.68f, 1.0f);
            rectPortraitTagSelector.anchorMax = new Vector2(0.68f, 1.0f);
            rectPortraitTagSelector.pivot     = new Vector2(0.5f, 0.5f);
            //           rectPortraitTagSelector.localPosition = preFabPos;
            rectPortraitTagSelector.localPosition -= rectPortraitTagSelector.forward;
            rectPortraitTagSelector.rotation       = Quaternion.identity;
            //TODO Initialize children positions (copy from prefab?)
            TextMeshProUGUI _Label    = portraitTagSelectorCanvas.transform.Find("LabelPlace/Label/LabelText").gameObject.GetComponent <TextMeshProUGUI>();
            RectTransform   rectLabel = (RectTransform)_Label.transform;

            rectLabel.anchoredPosition = rectLabel.parent.position;
            rectLabel.anchorMin        = new Vector2(0.0F, 1.0F);
            rectLabel.anchorMax        = new Vector2(0.0F, 1.0F);
            rectLabel.pivot            = new Vector2(0.5F, 0.5F);
            rectLabel.localPosition   += rectLabel.forward;
            UIHelpers.CopyTextMeshProUGUI(ref _Label, labelPreFab);
            CharBSequentialSelector charBSequentialSelector = portraitTagSelectorCanvas.transform.Find("SequentialSelector").gameObject.GetComponent <CharBSequentialSelector>();
            //Buttons
            Button BackButton = portraitTagSelectorCanvas.transform.Find("SequentialSelector/SequentialSelector/ButtonPlaceBackSelector").gameObject.GetComponent <Button>();

            charBSequentialSelector.m_BackButton = BackButton;
            Button NextButton = portraitTagSelectorCanvas.transform.Find("SequentialSelector/SequentialSelector/ButtonPlaceNextSelector").gameObject.GetComponent <Button>();

            charBSequentialSelector.m_NextButton = NextButton;
            TextMeshProUGUI Counter = portraitTagSelectorCanvas.transform.Find("SequentialSelector/SequentialSelector/GameObject/Counter").gameObject.GetComponent <TextMeshProUGUI>();

            charBSequentialSelector.m_Counter = Counter;
            charBSequentialSelector.m_Label   = _Label;
            Mod.Debug("Initialized");
            return(portraitTagSelectorCanvas.AddComponent <PortraitTagSelector>());
        }
        //Handling selected element change
        public void HandleChooseElement(CharBSequentialSelector selector, int index)
        {
            if (!base.gameObject.activeInHierarchy)
            {
                return;
            }
            if (selector == this.m_Tags)
            {
#if (DEBUG)
                Mod.Debug(MethodBase.GetCurrentMethod());
#endif
                portraitIDsUI = Tags.filterPortraitsUI(this.m_Tags.m_CurrentItemName.text, this.allPortraitsData);
                if (Game.Instance.UI.CharacterBuildController.Portrait.IsUnlocked)
                {
                    Game.Instance?.UI.CharacterBuildController.Portrait.PortraitSelector.HandleClickUpload(false);
                }
                //TODO: invoke increasing tag by index to (this.CurrentTagIndex);
            }
        }