当前位置: 首页>>代码示例>>C#>>正文


C# dfControl类代码示例

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


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


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