本文整理汇总了C#中ClickedEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# ClickedEventArgs类的具体用法?C# ClickedEventArgs怎么用?C# ClickedEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ClickedEventArgs类属于命名空间,在下文中一共展示了ClickedEventArgs类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: DoClick
private void DoClick(object sender, ClickedEventArgs e)
{
if (this.teleportOnClick)
{
float y = this.reference.position.y;
Plane plane = new Plane(Vector3.up, -y);
Ray ray = new Ray(base.transform.position, base.transform.forward);
bool flag = false;
float d = 0f;
if (this.teleportType == SteamVR_Teleporter.TeleportType.TeleportTypeUseCollider)
{
TerrainCollider component = Terrain.activeTerrain.GetComponent<TerrainCollider>();
RaycastHit raycastHit;
flag = component.Raycast(ray, out raycastHit, 1000f);
d = raycastHit.distance;
}
else if (this.teleportType == SteamVR_Teleporter.TeleportType.TeleportTypeUseCollider)
{
RaycastHit raycastHit2;
Physics.Raycast(ray, out raycastHit2);
d = raycastHit2.distance;
}
else
{
flag = plane.Raycast(ray, out d);
}
if (flag)
{
Vector3 position = ray.origin + ray.direction * d - new Vector3(this.reference.GetChild(0).localPosition.x, 0f, this.reference.GetChild(0).localPosition.z);
this.reference.position = position;
}
}
}
开发者ID:GameDiffs,项目名称:TheForest,代码行数:33,代码来源:SteamVR_Teleporter.cs
示例2: OnClicked
//*****************************************************************
void OnClicked(object sender, ClickedEventArgs e)
{
if(mDistanceFromPlayer > mMaxDistance)
return;
if( e.TargetObject == null)
return;
if( e.TargetObject.tag != "SecretPassage")
{
Debug.Log(e.TargetObject.tag);
return;
}
//Debug.Log(e.TargetObject.name);
// play the iTween animation
// If the object has a dedicated sound, play it. If not, play the default
if(mActivatedSound != String.Empty)
SoundManager.Play2DSound(mActivatedSound);
else
SoundManager.Play2DSound("hiddenPassage");
if (!isMoving)
{
bIsOpen = !bIsOpen;
isMoving = true;
runningTime = 0;
Vector3 temp;
temp = startVec;
startVec = endVec;
endVec = temp;
}
//Debug.Log("I WAS CLICKEDEDMF");
}
开发者ID:RollForReflex,项目名称:YouDunnit--Prototype,代码行数:33,代码来源:InteractiveObject.cs
示例3: OnClicked
private float mDistance = 0.0f; // Distance from player
#endregion Fields
#region Methods
void OnClicked(object sender, ClickedEventArgs e)
{
if (e.TargetObject != gameObject) return;
//if (mDistance > mPickupDistance ) return;
Debug.Log("Replacing stuff");
ReplaceMatchedAreaWithEquippedItem();
}
开发者ID:RollForReflex,项目名称:YouDunnit--Prototype,代码行数:13,代码来源:MatchedArea.cs
示例4: NotifyClicked
protected bool NotifyClicked()
{
ClickedEventArgs args = new ClickedEventArgs();
if (Clicked != null) {
Clicked(this, args);
}
return !args.ErrorOccurred;
}
开发者ID:appliedi,项目名称:MerchantTribe,代码行数:8,代码来源:NotifyClickControl.cs
示例5: TriggerDown
void TriggerDown(object sender, ClickedEventArgs e)
{
AxeInstance = (GameObject)Instantiate(AxePrefab, transform, false);
AxeInstance.GetComponent<Rigidbody>().isKinematic = true;
m_VelocityOverTime = Vector3.zero;
m_Velocity = Vector3.zero;
}
开发者ID:RandomTiger,项目名称:OgresLairVR,代码行数:8,代码来源:WeaponHand.cs
示例6: OnActivated
private void OnActivated(object sender, ClickedEventArgs e)
{
if (e.TargetObject != gameObject) return;
isActivated = true;
TriggerActivated();
}
开发者ID:Aeal,项目名称:ULib,代码行数:8,代码来源:ClickedTrigger.cs
示例7: OnDeactivated
private void OnDeactivated(object sender, ClickedEventArgs e)
{
if (!isActivated) return;
isActivated = false;
TriggerDeactivated();
}
开发者ID:Aeal,项目名称:ULib,代码行数:8,代码来源:ClickedTrigger.cs
示例8: btnSubmit_Clicked
public void btnSubmit_Clicked(object sender, ClickedEventArgs e)
{
IsValid();
if (GetField("IsValid").Value.ToLower() == "true")
{
GetField("FormName").SetValue(GetField("Sicil").Value);
int changingCount = GetField("ChangingCount").ValueAsInt + 1;
GetField("ChangingCount").SetValue(changingCount.ToString());
this.Submit();
}
else
{
this.ViewInfos.SwitchView("MessageView");
}
}
开发者ID:cambaz12,项目名称:FritoLay,代码行数:15,代码来源:FormCode.cs
示例9: PadTouched
void PadTouched(object sender, ClickedEventArgs e) {
//Debug.Log(((SteamVR_TrackedController)sender).transform.rotation.eulerAngles.y);
Vector3 controllerDirectionY = ((SteamVR_TrackedController)sender).transform.forward;
controllerDirectionY.y = 0f; // 2d
controllerDirectionY.Normalize();
controllerDirectionY *= e.padY;
Vector3 controllerDirectionX = ((SteamVR_TrackedController)sender).transform.right;
controllerDirectionX.y = 0f; // 2d
controllerDirectionX.Normalize();
controllerDirectionX *= e.padX;
Vector3 controllerDirection = controllerDirectionX + controllerDirectionY;
playerVector = controllerDirection * locomotionForce;
}
开发者ID:shole,项目名称:Receiver-7DFPS-SteamVR,代码行数:17,代码来源:SteamVR_Locomotion.cs
示例10: btnGetNameAndManager_Clicked
public void btnGetNameAndManager_Clicked(object sender, ClickedEventArgs e)
{
string firstname = string.Empty;
string lastname = string.Empty;
string manager = string.Empty;
XPathNavigator form = this.MainDataSource.CreateNavigator();
form.SelectSingleNode("/my:EmployeeForm/my:txtError", NamespaceManager).SetValue("");
try
{
string userID = form.SelectSingleNode("/my:EmployeeForm/my:txtUserID", NamespaceManager).Value;
XPathNavigator profileNav = this.DataSources["GetUserProfileByName"].CreateNavigator();
profileNav.SelectSingleNode("/dfs:myFields/dfs:queryFields/tns:GetUserProfileByName/tns:AccountName", NamespaceManager).SetValue(userID);
WebServiceConnection webServiceConnection = (WebServiceConnection)this.DataConnections["GetUserProfileByName"];
webServiceConnection.Execute();
string profileXPath = "/dfs:myFields/dfs:dataFields/tns:GetUserProfileByNameResponse/tns:GetUserProfileByNameResult/tns:PropertyData/tns:Values/tns:ValueData/tns:Value[../../../tns:Name = '{0}']";
if (profileNav.SelectSingleNode(string.Format(profileXPath, "FirstName"), NamespaceManager) != null)
{
firstname = profileNav.SelectSingleNode(string.Format(profileXPath, "FirstName"), NamespaceManager).Value;
}
if (profileNav.SelectSingleNode(string.Format(profileXPath, "LastName"), NamespaceManager) != null)
{
lastname = profileNav.SelectSingleNode(string.Format(profileXPath, "LastName"), NamespaceManager).Value;
}
if (profileNav.SelectSingleNode(string.Format(profileXPath, "Manager"), NamespaceManager) != null)
{
manager = profileNav.SelectSingleNode(string.Format(profileXPath, "Manager"), NamespaceManager).Value;
}
string userName = string.Format("{0} {1}", firstname, lastname);
form.SelectSingleNode("/my:EmployeeForm/my:txtName", NamespaceManager).SetValue(userName);
form.SelectSingleNode("/my:EmployeeForm/my:txtManager", NamespaceManager).SetValue(manager);
}
catch (Exception ex)
{
form.SelectSingleNode("/my:EmployeeForm/my:txtError", NamespaceManager).SetValue(ex.Message);
}
}
开发者ID:rajashekarusa,项目名称:PnP-Transformation,代码行数:44,代码来源:FormCode.cs
示例11: TriggerUp
void TriggerUp(object sender, ClickedEventArgs e)
{
if (AxeInstance == null || m_Hand == null)
{
return;
}
m_Velocity = m_Hand.GetVelocityEstimation();
Rigidbody rigidbody = AxeInstance.GetComponent<Rigidbody>();
AxeInstance.transform.parent = null;
rigidbody.isKinematic = false;
Vector3 direction = Vector3.Lerp(transform.up * -1.0f, transform.forward, 0.5f);
float magnitude = 1000.0f * m_Velocity.magnitude;
rigidbody.AddForce(direction * magnitude);
rigidbody.AddTorque(new Vector3(360.0f, 0, 0));
AxeInstance = null;
}
开发者ID:RandomTiger,项目名称:OgresLairVR,代码行数:21,代码来源:WeaponHand.cs
示例12: DoClick
void DoClick(object sender, ClickedEventArgs e)
{
if (teleportOnClick)
{
var t = reference;
if (t == null)
return;
float refY = t.position.y;
Plane plane = new Plane(Vector3.up, -refY);
Ray ray = new Ray(this.transform.position, transform.forward);
bool hasGroundTarget = false;
float dist = 0f;
if (teleportType == TeleportType.TeleportTypeUseTerrain)
{
RaycastHit hitInfo;
TerrainCollider tc = Terrain.activeTerrain.GetComponent<TerrainCollider>();
hasGroundTarget = tc.Raycast(ray, out hitInfo, 1000f);
dist = hitInfo.distance;
}
else if (teleportType == TeleportType.TeleportTypeUseCollider)
{
RaycastHit hitInfo;
Physics.Raycast(ray, out hitInfo);
dist = hitInfo.distance;
}
else
{
hasGroundTarget = plane.Raycast(ray, out dist);
}
if (hasGroundTarget)
{
Vector3 headPosOnGround = new Vector3(SteamVR_Render.Top().head.localPosition.x, 0.0f, SteamVR_Render.Top().head.localPosition.z);
t.position = ray.origin + ray.direction * dist - new Vector3(t.GetChild(0).localPosition.x, 0f, t.GetChild(0).localPosition.z) - headPosOnGround;
}
}
}
开发者ID:ConstLiu,项目名称:openvr,代码行数:40,代码来源:SteamVR_Teleporter.cs
示例13: DoClick
void DoClick(object sender, ClickedEventArgs e)
{
if (teleportOnClick)
{
// Teleport
float refY = reference.position.y;
Plane plane = new Plane(Vector3.up, -refY);
Ray ray = new Ray(this.transform.position, transform.forward);
bool hasGroundTarget = false;
float dist = 0f;
if (teleportType == TeleportType.TeleportTypeUseCollider)
{
RaycastHit hitInfo;
TerrainCollider tc = Terrain.activeTerrain.GetComponent<TerrainCollider>();
hasGroundTarget = tc.Raycast(ray, out hitInfo, 1000f);
dist = hitInfo.distance;
}
else if (teleportType == TeleportType.TeleportTypeUseCollider)
{
RaycastHit hitInfo;
Physics.Raycast(ray, out hitInfo);
dist = hitInfo.distance;
}
else
{
hasGroundTarget = plane.Raycast(ray, out dist);
}
if (hasGroundTarget)
{
Vector3 newPos = ray.origin + ray.direction * dist - new Vector3(reference.GetChild(0).localPosition.x, 0f, reference.GetChild(0).localPosition.z);
reference.position = newPos;
}
}
}
开发者ID:Black4Blade,项目名称:NewtonVR,代码行数:37,代码来源:SteamVR_Teleporter.cs
示例14: OnTriggerClicked
public virtual void OnTriggerClicked(ClickedEventArgs e)
{
if (this.TriggerClicked != null)
{
this.TriggerClicked(this, e);
}
}
开发者ID:GameDiffs,项目名称:TheForest,代码行数:7,代码来源:SteamVR_TrackedController.cs
示例15: OnPadUnclicked
public virtual void OnPadUnclicked(ClickedEventArgs e)
{
if (PadUnclicked != null)
PadUnclicked(this, e);
}
开发者ID:ConstLiu,项目名称:openvr,代码行数:5,代码来源:SteamVR_TrackedController.cs
示例16: OnSteamClicked
public virtual void OnSteamClicked(ClickedEventArgs e)
{
if (SteamClicked != null)
SteamClicked(this, e);
}
开发者ID:ConstLiu,项目名称:openvr,代码行数:5,代码来源:SteamVR_TrackedController.cs
示例17: OnMenuUnclicked
public virtual void OnMenuUnclicked(ClickedEventArgs e)
{
if (MenuButtonUnclicked != null)
MenuButtonUnclicked(this, e);
}
开发者ID:ConstLiu,项目名称:openvr,代码行数:5,代码来源:SteamVR_TrackedController.cs
示例18: OnTriggerUnclicked
public virtual void OnTriggerUnclicked(ClickedEventArgs e)
{
if (TriggerUnclicked != null)
TriggerUnclicked(this, e);
}
开发者ID:ConstLiu,项目名称:openvr,代码行数:5,代码来源:SteamVR_TrackedController.cs
示例19: OnUngripped
public virtual void OnUngripped(ClickedEventArgs e)
{
if (Ungripped != null)
Ungripped(this, e);
}
开发者ID:ConstLiu,项目名称:openvr,代码行数:5,代码来源:SteamVR_TrackedController.cs
示例20: OnGripped
public virtual void OnGripped(ClickedEventArgs e)
{
if (Gripped != null)
Gripped(this, e);
}
开发者ID:ConstLiu,项目名称:openvr,代码行数:5,代码来源:SteamVR_TrackedController.cs
注:本文中的ClickedEventArgs类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论