コード例 #1
0
    public override void Copy(SpriteRoot s, ControlCopyFlags flags)
    {
        base.Copy(s, flags);

        if (!(s is UITextField))
        {
            return;
        }

        UITextField b = (UITextField)s;


        if ((flags & ControlCopyFlags.Settings) == ControlCopyFlags.Settings)
        {
            maxLength        = b.maxLength;
            multiline        = b.multiline;
            password         = b.password;
            maskingCharacter = b.maskingCharacter;
            customKeyboard   = b.customKeyboard;
            customFocusEvent = b.customFocusEvent;
            margins          = b.margins;

#if UNITY_IPHONE || UNITY_ANDROID
            type        = b.type;
            autoCorrect = b.autoCorrect;
            alert       = b.alert;
            hideInput   = b.hideInput;
#endif
            typingSoundEffect = b.typingSoundEffect;
            fieldFullSound    = b.fieldFullSound;
        }

        if ((flags & ControlCopyFlags.Invocation) == ControlCopyFlags.Invocation)
        {
            scriptWithMethodToInvoke = b.scriptWithMethodToInvoke;
            methodToInvoke           = b.methodToInvoke;
        }

        if ((flags & ControlCopyFlags.Appearance) == ControlCopyFlags.Appearance)
        {
            caret.Copy(b.caret);

            caretSize         = b.caretSize;
            caretOffset       = b.caretOffset;
            caretAnchor       = b.caretAnchor;
            showCaretOnMobile = b.showCaretOnMobile;
        }

        if ((flags & ControlCopyFlags.State) == ControlCopyFlags.State)
        {
            insert = b.insert;
            Text   = b.Text;
        }

        SetMargins(margins);
    }
コード例 #2
0
ファイル: UISlider.cs プロジェクト: hhs900110/ProjectKT
    public override void Copy(SpriteRoot s, ControlCopyFlags flags)
    {
        base.Copy(s, flags);

        if (!(s is UISlider))
        {
            return;
        }

        UISlider b = (UISlider)s;


        if ((flags & ControlCopyFlags.Invocation) == ControlCopyFlags.Invocation)
        {
            scriptWithMethodToInvoke = b.scriptWithMethodToInvoke;
            methodToInvoke           = b.methodToInvoke;
        }

        if ((flags & ControlCopyFlags.Settings) == ControlCopyFlags.Settings)
        {
            defaultValue           = b.defaultValue;
            stopKnobFromEdge       = b.stopKnobFromEdge;
            knobOffset             = b.knobOffset;
            knobSize               = b.knobSize;
            knobColliderSizeFactor = b.knobColliderSizeFactor;
        }

        if ((flags & ControlCopyFlags.Appearance) == ControlCopyFlags.Appearance)
        {
            if (Application.isPlaying)
            {
                if (emptySprite != null)
                {
                    emptySprite.Copy(b.emptySprite);
                }

                if (knob != null)
                {
                    knob.Copy(b.knob);
                }

                truncFloor = b.truncFloor;
                truncRange = b.truncRange;
            }
        }

        if ((flags & ControlCopyFlags.State) == ControlCopyFlags.State)
        {
            CalcKnobStartPos();
            Value = b.Value;
        }
    }
コード例 #3
0
    public override void Copy(SpriteRoot s, ControlCopyFlags flags)
    {
        base.Copy(s, flags);

        if (!(s is UIProgressBar))
        {
            return;
        }

        if (Application.isPlaying)
        {
            UIProgressBar b = (UIProgressBar)s;


            if ((flags & ControlCopyFlags.Appearance) == ControlCopyFlags.Appearance)
            {
                if (emptySprite != null)
                {
                    emptySprite.Copy(b.emptySprite);
                }
            }
        }
    }
コード例 #4
0
    public override void Copy(SpriteRoot s, ControlCopyFlags flags)
    {
        base.Copy(s, flags);

        if (!(s is UITextField))
        {
            return;
        }

        UITextField b = (UITextField)s;


        if ((flags & ControlCopyFlags.Settings) == ControlCopyFlags.Settings)
        {
            maxLength = b.maxLength;

#if UNITY_IPHONE || UNITY_ANDROID
            type        = b.type;
            autoCorrect = b.autoCorrect;
            secure      = b.secure;
            alert       = b.alert;
#endif
            typingSoundEffect = b.typingSoundEffect;
            fieldFullSound    = b.fieldFullSound;
        }

        if ((flags & ControlCopyFlags.Appearance) == ControlCopyFlags.Appearance)
        {
            caret.Copy(b.caret);
        }

        if ((flags & ControlCopyFlags.State) == ControlCopyFlags.State)
        {
            insert = b.insert;
            Text   = b.Text;
        }
    }