本文整理汇总了C#中ClickedEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# ClickedEventArgs类的具体用法?C# ClickedEventArgs怎么用?C# ClickedEventArgs使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ClickedEventArgs类属于命名空间,在下文中一共展示了ClickedEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
}
}
示例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");
}
示例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();
}
示例4: NotifyClicked
protected bool NotifyClicked()
{
ClickedEventArgs args = new ClickedEventArgs();
if (Clicked != null) {
Clicked(this, args);
}
return !args.ErrorOccurred;
}
示例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;
}
示例6: OnActivated
private void OnActivated(object sender, ClickedEventArgs e)
{
if (e.TargetObject != gameObject) return;
isActivated = true;
TriggerActivated();
}
示例7: OnDeactivated
private void OnDeactivated(object sender, ClickedEventArgs e)
{
if (!isActivated) return;
isActivated = false;
TriggerDeactivated();
}
示例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");
}
}
示例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;
}
示例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);
}
}
示例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;
}
示例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;
}
}
}
示例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;
}
}
}
示例14: OnTriggerClicked
public virtual void OnTriggerClicked(ClickedEventArgs e)
{
if (this.TriggerClicked != null)
{
this.TriggerClicked(this, e);
}
}
示例15: OnPadUnclicked
public virtual void OnPadUnclicked(ClickedEventArgs e)
{
if (PadUnclicked != null)
PadUnclicked(this, e);
}