public override void Copy(IControl c, ControlCopyFlags flags)
    {
        base.Copy(c, flags);
        if (!(c is UIButton3D))
        {
            return;
        }
        UIButton3D uIButton3D = (UIButton3D)c;

        if ((flags & ControlCopyFlags.State) == ControlCopyFlags.State)
        {
            this.prevTransition = uIButton3D.prevTransition;
            if (Application.isPlaying)
            {
                this.SetControlState(uIButton3D.controlState);
            }
        }
        if ((flags & ControlCopyFlags.Invocation) == ControlCopyFlags.Invocation)
        {
            this.scriptWithMethodToInvoke = uIButton3D.scriptWithMethodToInvoke;
            this.methodToInvoke           = uIButton3D.methodToInvoke;
            this.whenToInvoke             = uIButton3D.whenToInvoke;
            this.delay = uIButton3D.delay;
        }
        if ((flags & ControlCopyFlags.Sound) == ControlCopyFlags.Sound)
        {
            this.soundOnOver  = uIButton3D.soundOnOver;
            this.soundOnClick = uIButton3D.soundOnClick;
        }
        if ((flags & ControlCopyFlags.Settings) == ControlCopyFlags.Settings)
        {
            this.repeat = uIButton3D.repeat;
        }
    }
Ejemplo n.º 2
0
    public override void Copy(SpriteRoot s, ControlCopyFlags flags)
    {
        base.Copy(s, flags);
        if (!(s is UIButton))
        {
            return;
        }
        UIButton uIButton = (UIButton)s;

        if ((flags & ControlCopyFlags.State) == ControlCopyFlags.State)
        {
            this.prevTransition = uIButton.prevTransition;
            if (Application.isPlaying)
            {
                this.SetControlState(uIButton.controlState);
            }
        }
        if ((flags & ControlCopyFlags.Invocation) == ControlCopyFlags.Invocation)
        {
            this.scriptWithMethodToInvoke = uIButton.scriptWithMethodToInvoke;
            this.methodToInvoke           = uIButton.methodToInvoke;
            this.whenToInvoke             = uIButton.whenToInvoke;
            this.delay = uIButton.delay;
        }
        if ((flags & ControlCopyFlags.Sound) == ControlCopyFlags.Sound)
        {
            this.soundOnOver  = uIButton.soundOnOver;
            this.soundOnClick = uIButton.soundOnClick;
        }
        if ((flags & ControlCopyFlags.Settings) == ControlCopyFlags.Settings)
        {
            this.repeat = uIButton.repeat;
        }
    }
    public override void Copy(SpriteRoot s, ControlCopyFlags flags)
    {
        base.Copy(s, flags);
        if (!(s is UIStateToggleBtn))
        {
            return;
        }
        UIStateToggleBtn uIStateToggleBtn = (UIStateToggleBtn)s;

        if ((flags & ControlCopyFlags.Settings) == ControlCopyFlags.Settings)
        {
            this.defaultState = uIStateToggleBtn.defaultState;
        }
        if ((flags & ControlCopyFlags.State) == ControlCopyFlags.State)
        {
            this.prevTransition = uIStateToggleBtn.prevTransition;
            if (Application.isPlaying)
            {
                this.SetToggleState(uIStateToggleBtn.StateNum);
            }
        }
        if ((flags & ControlCopyFlags.Invocation) == ControlCopyFlags.Invocation)
        {
            this.scriptWithMethodToInvoke = uIStateToggleBtn.scriptWithMethodToInvoke;
            this.methodToInvoke           = uIStateToggleBtn.methodToInvoke;
            this.whenToInvoke             = uIStateToggleBtn.whenToInvoke;
            this.delay = uIStateToggleBtn.delay;
        }
        if ((flags & ControlCopyFlags.Sound) == ControlCopyFlags.Sound)
        {
            this.soundToPlay = uIStateToggleBtn.soundToPlay;
        }
    }
    public override void Copy(IControl c, ControlCopyFlags flags)
    {
        base.Copy(c);
        if (!(c is UIStateToggleBtn3D))
        {
            return;
        }
        UIStateToggleBtn3D uIStateToggleBtn3D = (UIStateToggleBtn3D)c;

        if ((flags & ControlCopyFlags.Settings) == ControlCopyFlags.Settings)
        {
            this.defaultState = uIStateToggleBtn3D.defaultState;
        }
        if ((flags & ControlCopyFlags.State) == ControlCopyFlags.State)
        {
            this.prevTransition = uIStateToggleBtn3D.prevTransition;
            if (Application.isPlaying)
            {
                this.SetToggleState(uIStateToggleBtn3D.StateNum);
            }
        }
        if ((flags & ControlCopyFlags.Invocation) == ControlCopyFlags.Invocation)
        {
            this.scriptWithMethodToInvoke = uIStateToggleBtn3D.scriptWithMethodToInvoke;
            this.methodToInvoke           = uIStateToggleBtn3D.methodToInvoke;
            this.whenToInvoke             = uIStateToggleBtn3D.whenToInvoke;
            this.delay = uIStateToggleBtn3D.delay;
        }
        if ((flags & ControlCopyFlags.Sound) == ControlCopyFlags.Sound)
        {
            this.soundToPlay = uIStateToggleBtn3D.soundToPlay;
        }
    }
    public override void OnInput(POINTER_INFO ptr)
    {
        if (!this.m_controlIsEnabled)
        {
            return;
        }
        if (this.inputDelegate != null)
        {
            this.inputDelegate(ref ptr);
        }
        this.lastPtrType = ptr.type;
        POINTER_INFO.INPUT_EVENT evt = ptr.evt;
        switch (evt)
        {
        case POINTER_INFO.INPUT_EVENT.TAP:
            this.PanelClicked(ptr);
            goto IL_104;

        case POINTER_INFO.INPUT_EVENT.RIGHT_TAP:
        case POINTER_INFO.INPUT_EVENT.LONG_TAP:
        case POINTER_INFO.INPUT_EVENT.MOVE:
IL_59:
            if (evt != POINTER_INFO.INPUT_EVENT.PRESS)
            {
                goto IL_104;
            }
            if (!this.requireTap)
            {
                this.PanelClicked(ptr);
            }
            goto IL_104;

        case POINTER_INFO.INPUT_EVENT.MOVE_OFF:
        case POINTER_INFO.INPUT_EVENT.RELEASE_OFF:
            if (base.collider != null)
            {
                RaycastHit raycastHit;
                if (base.collider.Raycast(ptr.ray, out raycastHit, ptr.rayDepth))
                {
                    if (ptr.evt == POINTER_INFO.INPUT_EVENT.MOVE_OFF)
                    {
                        ptr.evt = POINTER_INFO.INPUT_EVENT.MOVE;
                    }
                    else
                    {
                        ptr.evt = POINTER_INFO.INPUT_EVENT.RELEASE;
                    }
                }
                else if (this.dismissOnMoveOff && this.m_panelState == UIBistateInteractivePanel.STATE.SHOWING)
                {
                    this.SetPanelState(UIBistateInteractivePanel.STATE.HIDDEN);
                }
            }
            goto IL_104;
        }
        goto IL_59;
IL_104:
        base.OnInput(ptr);
    }
Ejemplo n.º 6
0
 private void Mobileinput(ref POINTER_INFO ptr)
 {
     POINTER_INFO.INPUT_EVENT evt = ptr.evt;
     if (evt == POINTER_INFO.INPUT_EVENT.PRESS)
     {
         this.vClickedPos = ptr.origPos;
         this.SetJoystickEnable(true);
     }
 }
Ejemplo n.º 7
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);
    }
Ejemplo n.º 8
0
 public void Reuse(POINTER_INFO ptr)
 {
     this.evt        = ptr.evt;
     this.fingerID   = ptr.fingerID;
     this.actionID   = ptr.actionID;
     this.active     = ptr.active;
     this.devicePos  = ptr.devicePos;
     this.origPos    = ptr.origPos;
     this.inputDelta = ptr.inputDelta;
     this.isTap      = ptr.isTap;
     this.hitInfo    = default(RaycastHit);
     this.clickTime  = ptr.clickTime;
 }
Ejemplo n.º 9
0
 public void Reset(int actID)
 {
     this.fingerID   = 0;
     this.actionID   = actID;
     this.evt        = POINTER_INFO.INPUT_EVENT.NO_CHANGE;
     this.active     = false;
     this.devicePos  = Vector3.zero;
     this.origPos    = Vector3.zero;
     this.inputDelta = Vector3.zero;
     this.ray        = default(Ray);
     this.prevRay    = default(Ray);
     this.isTap      = true;
     this.hitInfo    = default(RaycastHit);
     this.clickTime  = 0f;
 }
Ejemplo n.º 10
0
 public void Copy(POINTER_INFO ptr)
 {
     this.type       = ptr.type;
     this.camera     = ptr.camera;
     this.id         = ptr.id;
     this.fingerID   = ptr.fingerID;
     this.actionID   = ptr.actionID;
     this.evt        = ptr.evt;
     this.active     = ptr.active;
     this.devicePos  = ptr.devicePos;
     this.origPos    = ptr.origPos;
     this.inputDelta = ptr.inputDelta;
     this.ray        = ptr.ray;
     this.prevRay    = ptr.prevRay;
     this.rayDepth   = ptr.rayDepth;
     this.isTap      = ptr.isTap;
     this.targetObj  = ptr.targetObj;
     this.layerMask  = ptr.layerMask;
     this.hitInfo    = ptr.hitInfo;
     this.clickTime  = ptr.clickTime;
 }
Ejemplo n.º 11
0
    public override void Copy(IControl c, ControlCopyFlags flags)
    {
        base.Copy(c, flags);

        if (!(c is UIButton3D))
        {
            return;
        }

        UIButton3D b = (UIButton3D)c;

        if ((flags & ControlCopyFlags.State) == ControlCopyFlags.State)
        {
            prevTransition = b.prevTransition;

            if (Application.isPlaying)
            {
                SetControlState(b.controlState);
            }
        }

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

        if ((flags & ControlCopyFlags.Sound) == ControlCopyFlags.Sound)
        {
            soundOnOver  = b.soundOnOver;
            soundOnClick = b.soundOnClick;
        }

        if ((flags & ControlCopyFlags.Settings) == ControlCopyFlags.Settings)
        {
            repeat = b.repeat;
        }
    }
Ejemplo n.º 12
0
    public override void Copy(IControl c, ControlCopyFlags flags)
    {
        if (!(c is UIRadioBtn3D))
        {
            return;
        }

        base.Copy(c);

        UIRadioBtn3D b = (UIRadioBtn3D)c;

        if ((flags & ControlCopyFlags.Settings) == ControlCopyFlags.Settings)
        {
            group        = b.group;
            defaultValue = b.defaultValue;
        }

        if ((flags & ControlCopyFlags.State) == ControlCopyFlags.State)
        {
            prevTransition = b.prevTransition;

            if (Application.isPlaying)
            {
                Value = b.Value;
            }
        }

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

        if ((flags & ControlCopyFlags.Sound) == ControlCopyFlags.Sound)
        {
            soundToPlay = b.soundToPlay;
        }
    }
Ejemplo n.º 13
0
    public override void Copy(SpriteRoot s, ControlCopyFlags flags)
    {
        base.Copy(s, flags);

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

        UIRadioBtn b = (UIRadioBtn)s;

        if ((flags & ControlCopyFlags.State) == ControlCopyFlags.State)
        {
            state          = b.state;
            prevTransition = b.prevTransition;
            if (Application.isPlaying)
            {
                Value = b.Value;
            }
        }

        if ((flags & ControlCopyFlags.Settings) == ControlCopyFlags.Settings)
        {
            group        = b.group;
            defaultValue = b.defaultValue;
        }

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

        if ((flags & ControlCopyFlags.Sound) == ControlCopyFlags.Sound)
        {
            soundToPlay = b.soundToPlay;
        }
    }
    public override void Copy(IControl c, ControlCopyFlags flags)
    {
        base.Copy(c);

        if (!(c is UIStateToggleBtn3D))
        {
            return;
        }

        UIStateToggleBtn3D b = (UIStateToggleBtn3D)c;

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

        if ((flags & ControlCopyFlags.State) == ControlCopyFlags.State)
        {
            prevTransition = b.prevTransition;

            if (Application.isPlaying)
            {
                SetToggleState(b.StateNum);
            }
        }

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

        if ((flags & ControlCopyFlags.Sound) == ControlCopyFlags.Sound)
        {
            soundToPlay = b.soundToPlay;
        }
    }
Ejemplo n.º 15
0
	public override void Copy(SpriteRoot s, ControlCopyFlags flags)
	{
		base.Copy(s, flags);

		if (!(s is UIRadioBtn))
			return;

		UIRadioBtn b = (UIRadioBtn)s;

		if ((flags & ControlCopyFlags.State) == ControlCopyFlags.State)
		{
			state = b.state;
			prevTransition = b.prevTransition;
			if (Application.isPlaying)
				Value = b.Value;
		}

		if ((flags & ControlCopyFlags.Settings) == ControlCopyFlags.Settings)
		{
			group = b.group;
			defaultValue = b.defaultValue;
		}

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

		if ((flags & ControlCopyFlags.Sound) == ControlCopyFlags.Sound)
		{
			soundToPlay = b.soundToPlay;
		}
	}
	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);
	}
Ejemplo n.º 17
0
 public void SetWhenToInvoke(POINTER_INFO.INPUT_EVENT Type)
 {
     EZGUI_Texture.whenToInvoke = Type;
 }
Ejemplo n.º 18
0
	public override void Copy(IControl c, ControlCopyFlags flags)
	{
		if (!(c is UIRadioBtn3D))
			return;

		base.Copy(c);

		UIRadioBtn3D b = (UIRadioBtn3D)c;

		if ((flags & ControlCopyFlags.Settings) == ControlCopyFlags.Settings)
		{
			group = b.group;
			defaultValue = b.defaultValue;
		}

		if ((flags & ControlCopyFlags.State) == ControlCopyFlags.State)
		{
			prevTransition = b.prevTransition;

			if (Application.isPlaying)
				Value = b.Value;
		}

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

		if ((flags & ControlCopyFlags.Sound) == ControlCopyFlags.Sound)
		{
			soundToPlay = b.soundToPlay;
		}
	}
Ejemplo n.º 19
0
 public void SetWhenToInvoke(POINTER_INFO.INPUT_EVENT _Type)
 {
     EZGUI_Button.whenToInvoke = _Type;
 }
Ejemplo n.º 20
0
	public override void Copy(SpriteRoot s, ControlCopyFlags flags)
	{
		base.Copy(s, flags);

		if (!(s is UIButton))
			return;

		UIButton btn = (UIButton)s;

		if ((flags & ControlCopyFlags.State) == ControlCopyFlags.State)
		{
			prevTransition = btn.prevTransition;

			if (Application.isPlaying)
				SetControlState(btn.controlState);
		}

		if ((flags & ControlCopyFlags.Invocation) == ControlCopyFlags.Invocation)
		{
			scriptWithMethodToInvoke = btn.scriptWithMethodToInvoke;
			methodToInvoke = btn.methodToInvoke;
			whenToInvoke = btn.whenToInvoke;
			delay = btn.delay;
		}

		if ((flags & ControlCopyFlags.Sound) == ControlCopyFlags.Sound)
		{
			soundOnOver = btn.soundOnOver;
			soundOnClick = btn.soundOnClick;
		}

		if ((flags & ControlCopyFlags.Settings) == ControlCopyFlags.Settings)
		{
			repeat = btn.repeat;
		}
	}
Ejemplo n.º 21
0
	public override void Copy(IControl c, ControlCopyFlags flags)
	{
		base.Copy(c, flags);

		if (!(c is UIButton3D))
			return;

		UIButton3D b = (UIButton3D)c;

		if ((flags & ControlCopyFlags.State) == ControlCopyFlags.State)
		{
			prevTransition = b.prevTransition;

			if (Application.isPlaying)
				SetControlState(b.controlState);
		}

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

		if ((flags & ControlCopyFlags.Sound) == ControlCopyFlags.Sound)
		{
			soundOnOver = b.soundOnOver;
			soundOnClick = b.soundOnClick;
		}

		if ((flags & ControlCopyFlags.Settings) == ControlCopyFlags.Settings)
		{
			repeat = b.repeat;
		}
	}
Ejemplo n.º 22
0
 public void SetWhenToInvoke(POINTER_INFO.INPUT_EVENT Type)
 {
     EZGUI_RadioButton.whenToInvoke = Type;
 }
    public override void OnInput(POINTER_INFO ptr)
    {
        if (null == this)
        {
            return;
        }
        if (!this.m_controlIsEnabled)
        {
            return;
        }
        if (this.inputDelegate != null)
        {
            this.inputDelegate(ref ptr);
        }
        POINTER_INFO.INPUT_EVENT evt = ptr.evt;
        switch (evt)
        {
        case POINTER_INFO.INPUT_EVENT.MOVE:
            if (this.panelManager == null)
            {
                this.panelManager = UIPanelManager.instance;
            }
            if (base.collider != null)
            {
                this.panelManager.MouseOverPanel = this;
            }
            if (this.m_panelState != UIInteractivePanel.STATE.OVER)
            {
                this.SetPanelState(UIInteractivePanel.STATE.OVER);
            }
            break;

        case POINTER_INFO.INPUT_EVENT.MOVE_OFF:
        case POINTER_INFO.INPUT_EVENT.RELEASE_OFF:
            if (base.collider != null)
            {
                RaycastHit raycastHit;
                if (!base.collider.Raycast(ptr.ray, out raycastHit, ptr.rayDepth))
                {
                    this.SetPanelState(UIInteractivePanel.STATE.NORMAL);
                    if (this.panelManager == null)
                    {
                        this.panelManager = UIPanelManager.instance;
                    }
                    this.panelManager.MouseOverPanel = null;
                }
                else if (ptr.evt == POINTER_INFO.INPUT_EVENT.MOVE_OFF)
                {
                    ptr.evt = POINTER_INFO.INPUT_EVENT.MOVE;
                }
                else
                {
                    ptr.evt = POINTER_INFO.INPUT_EVENT.RELEASE;
                }
            }
            break;

        case POINTER_INFO.INPUT_EVENT.DRAG:
            if (this.draggable && !ptr.callerIsControl)
            {
                if (ptr.inputDelta.sqrMagnitude != 0f)
                {
                    if (this.panelManager == null)
                    {
                        this.panelManager = UIPanelManager.instance;
                    }
                    if (base.collider != null)
                    {
                        this.panelManager.MouseOverPanel = this;
                    }
                    Plane plane = default(Plane);
                    plane.SetNormalAndPosition(base.transform.forward * -1f, base.transform.position);
                    float d;
                    plane.Raycast(ptr.ray, out d);
                    Vector3 vector = ptr.ray.origin + ptr.ray.direction * d;
                    plane.Raycast(ptr.prevRay, out d);
                    Vector3 b = ptr.prevRay.origin + ptr.prevRay.direction * d;
                    vector = base.transform.position + base.transform.InverseTransformDirection(vector - b);
                    if (this.constrainDragArea)
                    {
                        vector.x = Mathf.Clamp(vector.x, this.dragBoundaryMin.x, this.dragBoundaryMax.x);
                        vector.y = Mathf.Clamp(vector.y, this.dragBoundaryMin.y, this.dragBoundaryMax.y);
                        vector.z = Mathf.Clamp(vector.z, this.dragBoundaryMin.z, this.dragBoundaryMax.z);
                    }
                    base.transform.position = vector;
                    if (this.twinFormID != G_ID.NONE)
                    {
                        UIInteractivePanel uIInteractivePanel = this.panelManager.FindPanel((int)this.twinFormID) as UIInteractivePanel;
                        if (null != uIInteractivePanel)
                        {
                            plane = default(Plane);
                            plane.SetNormalAndPosition(uIInteractivePanel.transform.forward * -1f, uIInteractivePanel.transform.position);
                            plane.Raycast(ptr.ray, out d);
                            vector = ptr.ray.origin + ptr.ray.direction * d;
                            plane.Raycast(ptr.prevRay, out d);
                            b      = ptr.prevRay.origin + ptr.prevRay.direction * d;
                            vector = uIInteractivePanel.transform.position + uIInteractivePanel.transform.InverseTransformDirection(vector - b);
                            if (uIInteractivePanel.constrainDragArea)
                            {
                                vector.x = Mathf.Clamp(vector.x, uIInteractivePanel.dragBoundaryMin.x, uIInteractivePanel.dragBoundaryMax.x);
                                vector.y = Mathf.Clamp(vector.y, uIInteractivePanel.dragBoundaryMin.y, uIInteractivePanel.dragBoundaryMax.y);
                                vector.z = Mathf.Clamp(vector.z, uIInteractivePanel.dragBoundaryMin.z, uIInteractivePanel.dragBoundaryMax.z);
                            }
                            uIInteractivePanel.transform.position = vector;
                            uIInteractivePanel.SetPanelState(UIInteractivePanel.STATE.DRAGGING);
                        }
                    }
                    this.MoveChild(this.childFormID_0, this.childFormID_1);
                    this.SetPanelState(UIInteractivePanel.STATE.DRAGGING);
                }
            }
            break;

        default:
            if (evt == POINTER_INFO.INPUT_EVENT.PRESS)
            {
                if (this.panelManager == null)
                {
                    this.panelManager = UIPanelManager.instance;
                }
                if (base.collider != null)
                {
                    this.panelManager.FocusPanel     = this;
                    this.panelManager.MouseOverPanel = this;
                }
            }
            break;
        }
    }
Ejemplo n.º 24
0
	public override void Copy(SpriteRoot s, ControlCopyFlags flags)
	{
		base.Copy(s, flags);

		if (!(s is UIStateToggleBtn))
			return;

		UIStateToggleBtn b = (UIStateToggleBtn)s;

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

		if ((flags & ControlCopyFlags.State) == ControlCopyFlags.State)
		{
			prevTransition = b.prevTransition;

			if (Application.isPlaying)
				SetToggleState(b.StateNum);
		}

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

		if ((flags & ControlCopyFlags.Sound) == ControlCopyFlags.Sound)
		{
			soundToPlay = b.soundToPlay;
		}
	}
        public override void OnInput(ref POINTER_INFO ptr)
        {
            if (this.deleted)
            {
                return;
            }
            if (!this.m_controlIsEnabled || base.IsHidden())
            {
                base.OnInput(ref ptr);
                return;
            }
            if (this.inputDelegate != null)
            {
                this.inputDelegate(ref ptr);
            }
            if (!this.m_controlIsEnabled || base.IsHidden())
            {
                base.OnInput(ref ptr);
                return;
            }
            POINTER_INFO.INPUT_EVENT evt = ptr.evt;
            switch (evt)
            {
            case POINTER_INFO.INPUT_EVENT.PRESS:
                if (this.mouseDownDelegate != null)
                {
                    this.mouseDownDelegate(this);
                }
                goto IL_108;

            case POINTER_INFO.INPUT_EVENT.DOUBLE_PRESS:
            case POINTER_INFO.INPUT_EVENT.RELEASE:
            case POINTER_INFO.INPUT_EVENT.RIGHT_RELEASE:
IL_86:
                if (evt != POINTER_INFO.INPUT_EVENT.MOVE)
                {
                    goto IL_108;
                }
                if (this.mouseOverDelegate != null)
                {
                    this.mouseOverDelegate(this);
                }
                goto IL_108;

            case POINTER_INFO.INPUT_EVENT.RIGHT_PRESS:
                if (this.rightMouseDelegate != null)
                {
                    this.rightMouseDelegate(this);
                }
                goto IL_108;

            case POINTER_INFO.INPUT_EVENT.TAP:
                if (this.changeDelegate != null)
                {
                    this.changeDelegate(this);
                }
                goto IL_108;
            }
            goto IL_86;
IL_108:
            base.OnInput(ref ptr);
        }
Ejemplo n.º 26
0
    public override void OnInput(ref POINTER_INFO ptr)
    {
        base.OnInput(ref ptr);
        if (!this.m_controlIsEnabled)
        {
            return;
        }
        POINTER_INFO.INPUT_EVENT evt = ptr.evt;
        switch (evt)
        {
        case POINTER_INFO.INPUT_EVENT.MOVE_OFF:
            if (null != this.slider.list)
            {
                this.slider.list.overList = false;
            }
            this.clickKnob = false;
            this.moveValue = 0f;
            return;

        case POINTER_INFO.INPUT_EVENT.RELEASE_OFF:
IL_33:
            if (evt != POINTER_INFO.INPUT_EVENT.PRESS)
            {
                this.clickKnob = false;
                return;
            }
            this.prevPoint = this.GetLocalInputPoint(ptr.ray);
            this.clickKnob = true;
            this.moveValue = 0f;
            return;

        case POINTER_INFO.INPUT_EVENT.DRAG:
        {
            if (!this.slider.useknobButton)
            {
                return;
            }
            this.inputPoint = this.GetLocalInputPoint(ptr.ray);
            float scrollPos = this.GetScrollPos();
            this.dist      = this.inputPoint.x - this.prevPoint.x;
            this.prevPoint = this.inputPoint;
            this.newPos    = base.transform.localPosition;
            this.newPos.x  = Mathf.Clamp(this.newPos.x + this.dist, this.origPos.x, this.origPos.x + this.maxScrollPos);
            base.transform.localPosition = this.newPos;
            this.prevPoint.x             = Mathf.Clamp(this.prevPoint.x, this.origPos.x - this.colliderExtent, this.origPos.x + this.colliderExtent + this.maxScrollPos);
            this.moveValue = Mathf.Abs(this.GetScrollPos() - scrollPos);
            float num = this.maxScrollPos / this.slider.totalLineCount;
            this.moveValue *= num;
            if (this.moveValue > 1f)
            {
                this.moveValue = 1f;
            }
            if (this.dist > 0f)
            {
                this.slider.clickButton = false;
            }
            else
            {
                this.slider.clickButton = true;
            }
            this.slider.ScrollKnobMoved(this, this.GetScrollPos());
            this.clickKnob = true;
            return;
        }

        case POINTER_INFO.INPUT_EVENT.MOUSE_WHEEL:
            if (null != this.slider.list)
            {
                this.slider.list.overList = true;
            }
            return;
        }
        goto IL_33;
    }