• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# dfControl类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中dfControl的典型用法代码示例。如果您正苦于以下问题:C# dfControl类的具体用法?C# dfControl怎么用?C# dfControl使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



dfControl类属于命名空间,在下文中一共展示了dfControl类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: OnMouseMove

    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;

        }
    }
开发者ID:dashqasar,项目名称:GoogleMap,代码行数:28,代码来源:TouchThrow.cs


示例2: OnMouseDown

    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();

        }
    }
开发者ID:jscott1989,项目名称:public-access-wars,代码行数:25,代码来源:RadialContextMenu.cs


示例3: OnMouseMove

    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 );

        }
    }
开发者ID:AhrenLi,项目名称:2048,代码行数:30,代码来源:dfPanGesture.cs


示例4: OnMouseDown

 public void OnMouseDown( dfControl source, dfMouseEventArgs args )
 {
     StartPosition = CurrentPosition = args.Position;
     State = dfGestureState.Possible;
     StartTime = Time.realtimeSinceStartup;
     Delta = Vector2.zero;
 }
开发者ID:AhrenLi,项目名称:2048,代码行数:7,代码来源:dfPanGesture.cs


示例5: OnClick

 void OnClick( dfControl sender, dfMouseEventArgs args )
 {
     if( SelectOnClick != null )
     {
         SelectOnClick.Focus();
     }
 }
开发者ID:haozi000005,项目名称:happy2d,代码行数:7,代码来源:ControlNavigation.cs


示例6: OnClick

    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;

        }
    }
开发者ID:kvelury,项目名称:apocalyptia,代码行数:31,代码来源:dfCoverflow.cs


示例7: Start

	// Use this for initialization
	void Start () {
        radar = GetComponent<dfRadarMain>();
        RC = this;
        myControl = GetComponent<dfControl>();
        myControl.IsVisible = false;
        tween1 = GetComponent<dfTweenFloat>();
	}
开发者ID:TobyDGosselin,项目名称:Star-Sector,代码行数:8,代码来源:RadarController.cs


示例8: Start

 private void Start()
 {
     MenuCamera.mc.showShipManagement += initialize;
     slot = GetComponent<DraggableSpecialization>();
     control = dimmer.GetComponent<dfControl>();
     sdp = GetComponentInChildren<SpecializationDescriptionPanel>();
 }
开发者ID:TobyDGosselin,项目名称:Star-Sector,代码行数:7,代码来源:SpecializationSelectionSlot.cs


示例9: Awake

	// Use this for initialization
	void Awake ()
    {
        mtc = this;
        rm = GetComponent<dfRadialMenu>();
        myControl = GetComponent<dfControl>();
        cb = transform.parent.GetComponentInChildren<closeButton>();
	}
开发者ID:TobyDGosselin,项目名称:Star-Sector,代码行数:8,代码来源:ManualTargetingControls.cs


示例10: Awake

 private void Awake()
 {
     bb = this;
     control = GetComponent<dfControl>();
     tabcontainer = MenuTabContainer.tab;
     Hide();
 }
开发者ID:TobyDGosselin,项目名称:Star-Sector,代码行数:7,代码来源:BackButton.cs


示例11: Awake

 void Awake()
 {
     ss = this;
     control = GetComponent<dfControl>();
     sprite = GetComponent<dfSprite>();
     
 }
开发者ID:TobyDGosselin,项目名称:Star-Sector,代码行数:7,代码来源:ShipSprite.cs


示例12: OnTextChanged

	public void OnTextChanged( dfControl control, string value )
	{
		if( value != promptText )
		{
			_textbox.TextColor = textColor;
		}
	}
开发者ID:RainbowMin,项目名称:U3D_Match3,代码行数:7,代码来源:TextboxPrompt.cs


示例13: Initialize

	public void Initialize () 
    {
        if (control == null)
            control = GetComponent<dfControl>();
        s = GetComponent<dfProgressBar>();
        s.MinValue = 0;
        bvl = GetComponentInChildren<barValueLabel>();
        switch (owner)
        {
            case spawnBars.hudOwner.Player:
                shields = Target.GetComponentInChildren<Shield>();

                break;
            case spawnBars.hudOwner.Enemy:
                shields = Target.GetComponentInChildren<Shield>();
                break;
        }
        if (isGUITarget)
        {
            GUIReciever.shields = shields;
            GUIReciever.GUITarget = this;
            GUIReciever2.shields = shields;
            GUIReciever2.GUITarget = this;
        }
        if (owner != spawnBars.hudOwner.GUI)
        {
            shields.sBar = this;
            setValue();
        }
	}
开发者ID:TobyDGosselin,项目名称:Star-Sector,代码行数:30,代码来源:ShieldBarScript.cs


示例14: Awake

	void Awake () {
        cp = this;
        tween1 = GetComponent<dfTweenVector3>();
        tween2 = GetComponent<dfTweenFloat>();
        control = GetComponent<dfControl>();
        crewslots = FindObjectsOfType<CrewSlot>();
	}
开发者ID:TobyDGosselin,项目名称:Star-Sector,代码行数:7,代码来源:CrewPanel.cs


示例15: OnClick

    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");
    }
开发者ID:TobyDGosselin,项目名称:Star-Sector,代码行数:30,代码来源:ConfirmHull.cs


示例16: OnMultiTouch

    public void OnMultiTouch( dfControl control, dfTouchEventArgs touchData )
    {
        this.momentum = Vector2.zero;

        control.Color = Color.yellow;

        // Determine movement for each finger
        var touch1 = touchData.Touches[ 0 ];
        var touch2 = touchData.Touches[ 1 ];
        var dir1 = ( touch1.deltaPosition * ( Time.deltaTime / touch1.deltaTime ) ).Scale( 1, -1 );
        var dir2 = ( touch2.deltaPosition * ( Time.deltaTime / touch2.deltaTime ) ).Scale( 1, -1 );

        // Calculate size delta
        var pos1 = screenToGUI( touch1.position );
        var pos2 = screenToGUI( touch2.position );
        var currDist = pos1 - pos2;
        var prevDist = ( pos1 - dir1 ) - ( pos2 - dir2 );
        var delta = currDist.magnitude - prevDist.magnitude;

        if( Mathf.Abs( delta ) > float.Epsilon )
        {

            // Save relative position to restore after control's Size has changed
            var min = Vector3.Min( pos1, pos2 );
            var offset = min - control.RelativePosition;

            // Adjust the control's size according to the touch delta
            control.Size += Vector2.one * delta;

            // Put control back in relative position
            control.RelativePosition = min + offset;

        }
    }
开发者ID:dashqasar,项目名称:GoogleMap,代码行数:34,代码来源:TouchThrow.cs


示例17: Initialize

 public void Initialize()
 {
     if (control == null)
         control = GetComponent<dfControl>();
     s = gameObject.GetComponent<dfProgressBar>();
     s.MinValue = 0;
     bvl = GetComponentInChildren<barValueLabel>();
     switch (owner)
     {
         case spawnBars.hudOwner.Player:
             hull = Target.GetComponentInChildren<Hull>();
             break;
         case spawnBars.hudOwner.Enemy:
             hull = Target.GetComponentInChildren<Hull>();
             if (Target.layer == LayerMask.NameToLayer("NonPlayer"))
             {
                 Target.GetComponent<NPCController>().setBars(transform.parent.gameObject);//Redundant because it is also in Shieldbar script
             }
             else
                 Target.GetComponent<EnemyController>().setBars(transform.parent.gameObject);//Redundant because it is also in Shieldbar script
             break;
     }
     if (isGUITarget)
     {
         GUIReciever.hull = hull;
         GUIReciever.GUITarget = this;
     }
     if (owner != spawnBars.hudOwner.GUI)
     {
         hull.hBar = this;
         setValue();
     }
 }
开发者ID:TobyDGosselin,项目名称:Star-Sector,代码行数:33,代码来源:HullBarScript.cs


示例18: OnMouseHover

	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;
		}

	}
开发者ID:RainbowMin,项目名称:U3D_Match3,代码行数:35,代码来源:ActionbarsHoverEvents.cs


示例19: OnKeyDown

	void OnKeyDown( dfControl sender, dfKeyEventArgs args )
	{

		switch( args.KeyCode )
		{

			case KeyCode.Tab:
				if( args.Shift )
				{
					if( SelectOnShiftTab != null )
					{
						SelectOnShiftTab.Focus();
						args.Use();
					}
				}
				else if( SelectOnTab != null )
				{
					SelectOnTab.Focus();
					args.Use();
				}
				break;

			case KeyCode.LeftArrow:
				if( SelectOnLeft != null )
				{
					SelectOnLeft.Focus();
					args.Use();
				}
				break;

			case KeyCode.RightArrow:
				if( SelectOnRight != null )
				{
					SelectOnRight.Focus();
					args.Use();
				}
				break;

			case KeyCode.UpArrow:
				if( SelectOnUp != null )
				{
					SelectOnUp.Focus();
					args.Use();
				}
				break;

			case KeyCode.DownArrow:
				if( SelectOnDown != null )
				{
					SelectOnDown.Focus();
					args.Use();
				}
				break;

			default:
				break;

		}

	}
开发者ID:Elringus,项目名称:StarcorPreAlpha,代码行数:60,代码来源:ControlNavigation.cs


示例20: OnMouseDown

 protected void OnMouseDown( dfControl source, dfMouseEventArgs args )
 {
     StartPosition = CurrentPosition = args.Position;
     State = dfGestureState.Possible;
     StartTime = Time.realtimeSinceStartup;
     hoverTime = Time.realtimeSinceStartup;
 }
开发者ID:kvelury,项目名称:apocalyptia,代码行数:7,代码来源:dfFlickGesture.cs



注:本文中的dfControl类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# dfKeyEventArgs类代码示例发布时间:2022-05-24
下一篇:
C# dfAtlas类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap