本文整理汇总了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;
}
}
示例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();
}
}
示例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 );
}
}
示例4: OnMouseDown
public void OnMouseDown( dfControl source, dfMouseEventArgs args )
{
StartPosition = CurrentPosition = args.Position;
State = dfGestureState.Possible;
StartTime = Time.realtimeSinceStartup;
Delta = Vector2.zero;
}
示例5: OnClick
void OnClick( dfControl sender, dfMouseEventArgs args )
{
if( SelectOnClick != null )
{
SelectOnClick.Focus();
}
}
示例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;
}
}
示例7: Start
// Use this for initialization
void Start () {
radar = GetComponent<dfRadarMain>();
RC = this;
myControl = GetComponent<dfControl>();
myControl.IsVisible = false;
tween1 = GetComponent<dfTweenFloat>();
}
示例8: Start
private void Start()
{
MenuCamera.mc.showShipManagement += initialize;
slot = GetComponent<DraggableSpecialization>();
control = dimmer.GetComponent<dfControl>();
sdp = GetComponentInChildren<SpecializationDescriptionPanel>();
}
示例9: Awake
// Use this for initialization
void Awake ()
{
mtc = this;
rm = GetComponent<dfRadialMenu>();
myControl = GetComponent<dfControl>();
cb = transform.parent.GetComponentInChildren<closeButton>();
}
示例10: Awake
private void Awake()
{
bb = this;
control = GetComponent<dfControl>();
tabcontainer = MenuTabContainer.tab;
Hide();
}
示例11: Awake
void Awake()
{
ss = this;
control = GetComponent<dfControl>();
sprite = GetComponent<dfSprite>();
}
示例12: OnTextChanged
public void OnTextChanged( dfControl control, string value )
{
if( value != promptText )
{
_textbox.TextColor = textColor;
}
}
示例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();
}
}
示例14: Awake
void Awake () {
cp = this;
tween1 = GetComponent<dfTweenVector3>();
tween2 = GetComponent<dfTweenFloat>();
control = GetComponent<dfControl>();
crewslots = FindObjectsOfType<CrewSlot>();
}
示例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");
}