コード例 #1
1
ファイル: TouchThrow.cs プロジェクト: dashqasar/GoogleMap
    public void OnMouseMove( dfControl control, dfMouseEventArgs args )
    {
        if( animating || !dragging )
            return;

        this.momentum = ( momentum + args.MoveDelta.Scale( 1, -1 ) ) * 0.5f;

        args.Use();

        if( args.Buttons.IsSet( dfMouseButtons.Left ) )
        {

            var ray = args.Ray;
            var distance = 0f;
            var direction = Camera.main.transform.TransformDirection( Vector3.back );
            var plane = new Plane( direction, lastPosition );
            plane.Raycast( ray, out distance );

            var pos = ( ray.origin + ray.direction * distance ).Quantize( control.PixelsToUnits() );
            var offset = pos - lastPosition;

            var transformPos = ( control.transform.position + offset ).Quantize( control.PixelsToUnits() );
            control.transform.position = transformPos;

            lastPosition = pos;

        }
    }
コード例 #2
0
    public void OnMouseDown( dfControl source, dfMouseEventArgs args )
    {
        if( State == dfGestureState.Possible )
        {

            var elapsed = Time.realtimeSinceStartup - StartTime;
            if( elapsed <= timeout && Vector2.Distance( args.Position, StartPosition ) <= maxDistance )
            {

                StartPosition = CurrentPosition = args.Position;

                State = dfGestureState.Began;

                if( DoubleTapGesture != null ) DoubleTapGesture( this );
                gameObject.Signal( "OnDoubleTapGesture", this );

                endGesture();

                return;

            }

        }

        StartPosition = CurrentPosition = args.Position;
        State = dfGestureState.Possible;
        StartTime = Time.realtimeSinceStartup;
    }
コード例 #3
0
 public void OnMouseMove( dfControl control, dfMouseEventArgs mouseEvent )
 {
     if( mouseEvent.Buttons == dfMouseButtons.Left )
     {
         updateHotspot( mouseEvent );
     }
 }
コード例 #4
0
ファイル: dfFlickGesture.cs プロジェクト: kvelury/apocalyptia
 protected void OnMouseDown( dfControl source, dfMouseEventArgs args )
 {
     StartPosition = CurrentPosition = args.Position;
     State = dfGestureState.Possible;
     StartTime = Time.realtimeSinceStartup;
     hoverTime = Time.realtimeSinceStartup;
 }
コード例 #5
0
 void OnClick( dfControl sender, dfMouseEventArgs args )
 {
     if( SelectOnClick != null )
     {
         SelectOnClick.Focus();
     }
 }
コード例 #6
0
ファイル: dfPanGesture.cs プロジェクト: AhrenLi/2048
 public void OnMouseDown( dfControl source, dfMouseEventArgs args )
 {
     StartPosition = CurrentPosition = args.Position;
     State = dfGestureState.Possible;
     StartTime = Time.realtimeSinceStartup;
     Delta = Vector2.zero;
 }
コード例 #7
0
    public void OnMouseDown( dfControl control, dfMouseEventArgs args )
    {
        if( !args.Used && args.Buttons == dfMouseButtons.Middle )
        {

            if( contextMenu.IsOpen )
            {
                contextMenu.Close();
                return;
            }

            args.Use();

            var hitPosition = control.GetHitPosition( args );
            var host = contextMenu.host;

            host.RelativePosition = hitPosition - host.Size * 0.5f;
            host.BringToFront();
            host.Show();
            host.Focus();

            contextMenu.Open();

        }
    }
コード例 #8
0
ファイル: dfPanGesture.cs プロジェクト: AhrenLi/2048
    public void OnMouseMove( dfControl source, dfMouseEventArgs args )
    {
        if( State == dfGestureState.Possible )
        {
            if( Vector2.Distance( args.Position, StartPosition ) >= minDistance )
            {

                State = dfGestureState.Began;

                CurrentPosition = args.Position;
                Delta = args.Position - StartPosition;

                if( PanGestureStart != null ) PanGestureStart( this );
                gameObject.Signal( "OnPanGestureStart", this );

            }
        }
        else if( State == dfGestureState.Began || State == dfGestureState.Changed )
        {

            State = dfGestureState.Changed;

            Delta = args.Position - CurrentPosition;
            CurrentPosition = args.Position;

            if( PanGestureMove != null ) PanGestureMove( this );
            gameObject.Signal( "OnPanGestureMove", this );

        }
    }
コード例 #9
0
ファイル: dfDragHandle.cs プロジェクト: AhrenLi/2048
    protected internal override void OnMouseMove( dfMouseEventArgs args )
    {
        args.Use();

        if( args.Buttons.IsSet( dfMouseButtons.Left ) )
        {

            var ray = args.Ray;
            var distance = 0f;
            var direction = GetCamera().transform.TransformDirection( Vector3.back );
            var plane = new Plane( direction, lastPosition );
            plane.Raycast( ray, out distance );

            var pos = ( ray.origin + ray.direction * distance ).Quantize( parent.PixelsToUnits() );
            var offset = pos - lastPosition;

            var transformPos = ( parent.transform.position + offset ).Quantize( parent.PixelsToUnits() );
            parent.transform.position = transformPos;

            lastPosition = pos;

        }

        base.OnMouseMove( args );
    }
コード例 #10
0
    public void OnClick(dfControl control, dfMouseEventArgs mouseEvent)
    {

        Ship.PlayerController.pHull hull;
        switch(shipSelect.selectedIndex)
        {
            case 0:
                hull = Ship.PlayerController.pHull.Viper;
                GameManager.Instance.initializeShip(hull);
                break;
            case 1:
                hull = Ship.PlayerController.pHull.Anvil;
                GameManager.Instance.initializeShip(hull);
                break;
            case 2:
                hull = Ship.PlayerController.pHull.Shark;
                GameManager.Instance.initializeShip(hull);
                break;
            case 3:
                hull = Ship.PlayerController.pHull.Marauder;
                GameManager.Instance.initializeShip(hull);
                break;
            case 4:
                hull = Ship.PlayerController.pHull.Vulture;
                GameManager.Instance.initializeShip(hull);
                break;

        }
        Application.LoadLevel("CustomizeShip");
    }
コード例 #11
0
ファイル: dfCoverflow.cs プロジェクト: kvelury/apocalyptia
    public void OnClick( dfControl sender, dfMouseEventArgs args )
    {
        // No need to do anything unless an actual item was clicked
        if( args.Source == container )
            return;

        // Do not process click event if the user was scrolling by
        // dragging the mouse. Not needed for mobile.
        if( Vector2.Distance( args.Position, touchStartPosition ) > 20 )
            return;

        // Find highest-level control containing the click
        var source = args.Source;
        while( source != null && !controls.Contains( source ) )
        {
            source = source.Parent;
        }

        // If an item in the scroller was clicked, select it
        if( source != null )
        {

            // Select the clicked item
            lastSelected = -1;
            setSelectedIndex( controls.IndexOf( source ) );

            // Do not need to try to select "most centered" item
            isMouseDown = false;

        }
    }
コード例 #12
0
	public void OnMouseHover( dfControl control, dfMouseEventArgs mouseEvent )
	{

		if( isTooltipVisible )
			return;

		var isSpellSlot = actionBar.Controls.Contains( mouseEvent.Source );
		if( isSpellSlot )
		{

			target = mouseEvent.Source;
			if( target == lastTarget )
				return;

			lastTarget = target;

			isTooltipVisible = true;

			var slot = target.GetComponentInChildren<SpellSlot>();
			if( string.IsNullOrEmpty( slot.Spell ) )
				return;

			var spell = SpellDefinition.FindByName( slot.Spell );
			if( spell == null )
				return;

			ActionbarsTooltip.Show( spell );

		}
		else
		{
			lastTarget = null;
		}

	}
コード例 #13
0
 public void OnClick(dfControl control, dfMouseEventArgs mouseEvent)
 {
     rm.enabled = true;
     rm.Close();
     ManualTargetingControls.mtc.cancelAllTurrets();
     Label.Display("Target Weapon");
     Hide();
 }
コード例 #14
0
 public void OnMouseHover( dfControl source, dfMouseEventArgs args )
 {
     if( State == dfGestureState.Possible && Time.realtimeSinceStartup - hoverTime >= timeout )
     {
         StartPosition = CurrentPosition = args.Position;
         StartTime = Time.realtimeSinceStartup;
     }
 }
コード例 #15
0
 public void OnClick( dfControl control, dfMouseEventArgs mouseEvent )
 {
     if( colorField != null )
     {
         colorField.Hue = HSBColor.GetHue( control.Color );
         colorField.SelectedColor = control.Color;
     }
 }
コード例 #16
0
    /// <summary>
    /// Starts a new game
    /// </summary>
    /// <param name="s">Button</param>
    /// <param name="e">Mouse events</param>
    /// <remarks>
    /// <para>
    /// Only hides the main menu and displays the New Game UI
    /// </para>
    /// </remarks>
    public void UI_Button_NewGame_Click(dfControl s, dfMouseEventArgs e)
    {
        //Show the New Game UI
        uim.HideUI(UIManager.UIELEMENTS.MainMenu);
        uim.ShowUI(UIManager.UIELEMENTS.NewGameUI);


    }
コード例 #17
0
ファイル: HelpButton.cs プロジェクト: jackmott/solescape
    public void HelpClicked(dfControl control, dfMouseEventArgs args)
    {
        args.Use();
        TextAsset description = Resources.Load<TextAsset>("Descriptions/" + bi.className);
        GameObject prefab = (GameObject)Resources.Load("Prefabs/Buildings/" + bi.className);

        Dialog.Instance.SetDialog(bi.buildingName, description.text, "Continue", true, false,prefab);
    }
コード例 #18
0
    public bool loadNext = false; // load the next scenario instead of the one specified.

    #endregion Fields

    #region Methods

    public void OnClick( dfControl control, dfMouseEventArgs mouseEvent )
    {
        if(loadNext) {
            CaseHandler.Instance.ActivateNext();
        } else {
            CaseHandler.Instance.ActivateCase(CaseType);
        }
        Application.LoadLevel("IntroRespCase");
    }
コード例 #19
0
 public void OnClick( dfControl control, dfMouseEventArgs mouseEvent )
 {
     if(UILogger.UILog.ContainsKey(this.name)) {
         UILogger.UILog[this.name]++;
     } else {
         UILogger.UILog.Add(this.name,1);
     }
     UILogger.ButtonsPressed.Add(this.name);
 }
コード例 #20
0
ファイル: Pagination.cs プロジェクト: HexHash/LegacyRust
 public void OnButtonClicked(dfControl control, dfMouseEventArgs mouseEvent)
 {
     int num = int.Parse(control.Tooltip);
     this.Setup(this.pageCount, num);
     if (this.OnPageSwitch != null)
     {
         this.OnPageSwitch(num);
     }
 }
コード例 #21
0
    void OnClick( dfControl sender, dfMouseEventArgs args )
    {
        #if UNITY_EDITOR
        if( Application.isEditor )
            UnityEditor.EditorApplication.isPlaying = false;
        #endif

        Application.Quit();
    }
コード例 #22
0
    public void OnClick( dfControl control, dfMouseEventArgs mouseEvent )
    {
        keyListener.HideQuitPanel();
        keyListener.QuitPanelShowing = false;

        if (Application.loadedLevelName.Equals("Game"))
        {
            GlobalPreferences.TogglePause();
        }
    }
コード例 #23
0
    //    private int clickCount = 0;
    public void OnClick(dfControl control, dfMouseEventArgs mouseEvent)
    {
        Debug.Log (this.transform.name);

        if (showCurrentOperation)
        {

            StartCoroutine (ShowMessage (text, 3));
        }
    }
コード例 #24
0
 public void OnClick(dfControl control, dfMouseEventArgs mouseEvent)
 {
     if (!CrewPanel.cp.isOpen)
     {
         CrewPanel.cp.Show();
         return;
     }
     else
         CrewPanel.cp.Hide();
 }
コード例 #25
0
    public void OnMouseMove( dfControl source, dfMouseEventArgs args )
    {
        hoverTime = Time.realtimeSinceStartup;

        if( State == dfGestureState.Possible || State == dfGestureState.Began )
        {
            State = dfGestureState.Began;
            CurrentPosition = args.Position;
        }
    }
コード例 #26
0
ファイル: MakeChoice.cs プロジェクト: CoryBerg/drexelNeonatal
 public void OnClick(dfControl control, dfMouseEventArgs mouseEvent)
 {
     if(StethescopeOverride && StethescopeTarget != null) {
         handler.HandleStethescopeAnimation(StethescopeTarget);
         return;
     } else if(StethescopeTarget == null && StethescopeOverride) {
         throw new MissingReferenceException("Stethoscope target is missing");
     }
     handler.HandleAnimation (transform.name);
     CaseInitializer.Instance.ActiveCase.isCorrect = IsAnswer;
 }
コード例 #27
0
 public void OnClick(dfControl control, dfMouseEventArgs mouseEvent)
 {
     if (SpecializationsPanel.sp.isOpen)
     {
         SpecializationsPanel.sp.Hide();
         infoPanel.ip.Show();
         PowerManagementPanel.pmp.Show();
     }
     PowerManagementPanel.pmp.setTab(1);
     infoPanel.ip.setTab(1);
 }
コード例 #28
0
    public void OnClick( dfControl control, dfMouseEventArgs mouseEvent )
    {
        //Use Parse to save this score to the global rankings.
        ParseObject HighScoreObject = new ParseObject("HighScoreObject");

        HighScoreObject["Name"] = NameEntry.Text;
        HighScoreObject["Score"] = PlayerObject.Score;

        GlobalPreferences.LastHighScoreName = NameEntry.Text;
        HighScoreObject.SaveAsync();
    }
コード例 #29
0
ファイル: dfTapGesture.cs プロジェクト: Elringus/HajiJam
	public void OnMouseMove( dfControl source, dfMouseEventArgs args )
	{
		if( State == dfGestureState.Possible || State == dfGestureState.Began )
		{
			CurrentPosition = args.Position;
			if( Vector2.Distance( args.Position, StartPosition ) > maxDistance )
			{
				State = dfGestureState.Failed;
			}
		}
	}
コード例 #30
0
ファイル: dfDragHandle.cs プロジェクト: HexHash/LegacyRust
 protected internal override void OnMouseDown(dfMouseEventArgs args)
 {
     base.GetRootContainer().BringToFront();
     args.Use();
     Plane plane = new Plane(this.parent.transform.TransformDirection(Vector3.back), this.parent.transform.position);
     Ray ray = args.Ray;
     float single = 0f;
     plane.Raycast(args.Ray, out single);
     this.lastPosition = ray.origin + (ray.direction * single);
     base.OnMouseDown(args);
 }
コード例 #31
0
 void TipsBehaviour_MouseHover(dfControl control, dfMouseEventArgs mouseEvent)
 {
     updateTipText(TipState.TargetBehavior);
 }
コード例 #32
0
 public void OnMouseDown(dfControl control, dfMouseEventArgs mouseEvent)
 {
     isMouseDown = true;
 }
コード例 #33
0
 void focusAreas_MouseHover(dfControl control, dfMouseEventArgs mouseEvent)
 {
     updateTipText(TipState.FocusAreas);
 }
コード例 #34
0
 void RunBestButton_Click(dfControl control, dfMouseEventArgs mouseEvent)
 {
     Optimizer.RunBest();
 }
コード例 #35
0
 void OKButton_Click(dfControl control, dfMouseEventArgs mouseEvent)
 {
     panel.Hide();
 }
コード例 #36
0
 public void OnMouseDown(dfControl control, dfMouseEventArgs mouseEvent)
 {
     updateHotspot(mouseEvent);
 }
コード例 #37
0
 void ForgotButton_Click(dfControl control, dfMouseEventArgs mouseEvent)
 {
     loginPanel.Disable();
     DialogPanel.ShowResetPassword();
 }
コード例 #38
0
ファイル: ihntButtonBase.cs プロジェクト: k-payl/Runner
 public virtual void OnClick(dfControl control, dfMouseEventArgs args)
 {
     switchPanelBehaviour.Switch();
 }
コード例 #39
0
ファイル: dfListbox.cs プロジェクト: sknchan/LegacyRust
	protected internal override void OnMouseLeave(dfMouseEventArgs args)
	{
		base.OnMouseLeave(args);
		this.hoverIndex = -1;
	}
コード例 #40
0
ファイル: dfListbox.cs プロジェクト: sknchan/LegacyRust
	protected internal override void OnMouseEnter(dfMouseEventArgs args)
	{
		base.OnMouseEnter(args);
		this.touchStartPosition = args.Position;
	}
コード例 #41
0
 protected internal override void OnMouseWheel(dfMouseEventArgs args)
 {
     this.SelectedIndex = Mathf.Max(0, this.SelectedIndex - Mathf.RoundToInt(args.WheelDelta));
     args.Use();
     base.OnMouseWheel(args);
 }
コード例 #42
0
 public void OnClick(dfControl control, dfMouseEventArgs mouseEvent)
 {
     controller.doNotPlayLogin();
 }
コード例 #43
0
 void StationMenuButton1_Click(dfControl s, dfMouseEventArgs e)
 {
     print("Market");
 }
コード例 #44
0
 public void OnMouseUp(dfControl control, dfMouseEventArgs mouseEvent)
 {
     isMouseDown = false;
 }
コード例 #45
0
ファイル: MissionUI.cs プロジェクト: richardlalancette/Thesis
 void StartButton_Click(dfControl control, dfMouseEventArgs mouseEvent)
 {
     Initialize();
 }
コード例 #46
0
 public void OnClick(dfControl control, dfMouseEventArgs mouseEvent)
 {
     Application.LoadLevel(Application.loadedLevel);
 }
コード例 #47
0
 private void MouseEventProxy(dfControl control, dfMouseEventArgs mouseEvent)
 {
     this.callProxyEventHandler();
 }
コード例 #48
0
 public void UI_Button_CancelLoad_Click(dfControl s, dfMouseEventArgs e)
 {
     uim.HideUI(UIManager.UIELEMENTS.LoadGameUI);
     uim.ShowUI(UIManager.UIELEMENTS.MainMenu);
 }
コード例 #49
0
 void ResetButton_MouseHover(dfControl control, dfMouseEventArgs mouseEvent)
 {
     // print("ResetButton_MouseHover");
     mouseEvent.Use();
     updateTipText(TipState.ResetButton);
 }
コード例 #50
0
 public void OnClick(dfControl control, dfMouseEventArgs mouseEvent)
 {
     StartCoroutine("ShowLeaderBoard");
 }
コード例 #51
0
 public void OnMouseDown(dfControl source, dfMouseEventArgs args)
 {
     State         = dfGestureState.Possible;
     StartPosition = CurrentPosition = args.Position;
     StartTime     = Time.realtimeSinceStartup;
 }
コード例 #52
0
 void StationMenuButton4_Click(dfControl s, dfMouseEventArgs e)
 {
 }
コード例 #53
0
 public void UI_Button_DeleteGame_Click(dfControl s, dfMouseEventArgs e)
 {
 }
コード例 #54
0
 protected internal override void OnMouseDown(dfMouseEventArgs args)
 {
     base.OnMouseDown(args);
     this.touchStartPosition = args.Position;
     this.isMouseDown        = true;
 }
コード例 #55
0
 void TrainButton_MouseHover(dfControl control, dfMouseEventArgs mouseEvent)
 {
     updateTipText(TipState.TrainButton);
 }
コード例 #56
0
ファイル: dfEventBinding.cs プロジェクト: Elringus/HajiJam
 public void MouseEventProxy(dfControl control, dfMouseEventArgs mouseEvent)
 {
     callProxyEventHandler(control, mouseEvent);
 }
コード例 #57
0
 protected internal override void OnMouseUp(dfMouseEventArgs args)
 {
     base.OnMouseUp(args);
     this.isMouseDown = false;
 }
コード例 #58
0
 void panel_MouseHover(dfControl control, dfMouseEventArgs mouseEvent)
 {
     updateTipText(TipState.None);
 }
コード例 #59
0
ファイル: dfResizeHandle.cs プロジェクト: sknchan/LegacyRust
 protected internal override void OnMouseUp(dfMouseEventArgs args)
 {
     base.Parent.MakePixelPerfect(true);
     args.Use();
     base.OnMouseUp(args);
 }
コード例 #60
0
 void LoginButton_Click(dfControl control, dfMouseEventArgs mouseEvent)
 {
     StartCoroutine(TryLogin());
 }