Esempio n. 1
0
        internal HC.MultiToggleMember Set(HC.MultiToggleMember c)
        {
            c.toggleName   = toggleName;
            c.toggleNumber = toggleNumber;
            c.toggleValue  = toggleValue;

            return(c);
        }
Esempio n. 2
0
            internal override void Destroy()
            {
                base.Destroy();

                toggle            = null;
                backImage         = null;
                checkImage        = null;
                text              = null;
                multiToggleMember = null;
            }
Esempio n. 3
0
        protected override void AddComponents()
        {
            // Agrega los ubObjetos del Button
            var backgroundGO = InstanciateUIObject("Background", gameObject);
            var checkmarkGO  = InstanciateUIObject("Checkmark", backgroundGO);
            var labelGO      = InstanciateUIObject("Label", gameObject);


            toggleCmp            = propsToggle().Set(gameObject);
            backImageCmp         = propsBackImage().Set(backgroundGO);
            checkImageCmp        = propsCheckImage().Set(checkmarkGO);
            textCmp              = propsText().Set(labelGO);
            multiToggleMemberCmp = propsMultiToggleMember().Set(gameObject);

            toggleCmp.targetGraphic = backImageCmp;
            toggleCmp.graphic       = checkImageCmp;


            // Obtain percentage size
            SetReferenceSize(new RectTransformSetter());



            // backgroundGO rect
            new RectTransformBSetter()
            {
                //pivot = new Vector2(0f, 1f),
                localPosition = GetPercentageSize(34, -30), // 34,-30
                sizeDelta     = GetPercentageSize(44, 44),  // 44,44
                anchorMin     = new Vector2(0f, 1f),
                anchorMax     = new Vector2(0f, 1f),
            }.SetOrSearchBySizeDelta(backgroundGO);

            new RectTransformBSetter()
            {
                //pivot = new Vector2(0f, 1f),
                //localPosition = new Vector2(0, 0f),
                sizeDelta = GetPercentageSize(34, 34),  // 34,34
                //anchorMin = new Vector2(0f, 1f),
                //anchorMax = new Vector2(0f, 1f),
            }.SetOrSearchBySizeDelta(checkmarkGO);

            new RectTransformBSetter()
            {
                anchorMin = new Vector2(0f, 0f),
                anchorMax = new Vector2(1f, 1f),
                offsetMin = GetPercentageSize(70, 8),  // 70,8
                offsetMax = GetPercentageSize(-8, -8), // -8,-8
            }.SetOrSearchByAnchors(labelGO);
        }
Esempio n. 4
0
 internal Selector(
     GameObject gameObject,
     HC.ReactorId pieceId,
     RectTransform rectTransform,
     Toggle toggle,
     Image backImage,
     Image checkImage,
     Text text,
     HC.MultiToggleMember multiToggleMember
     ) : base(gameObject, pieceId, rectTransform)
 {
     this.toggle            = toggle;
     this.backImage         = backImage;
     this.checkImage        = checkImage;
     this.text              = text;
     this.multiToggleMember = multiToggleMember;
 }