public virtual void EmitAngularVelocity() { if (Source == null) { return; } AngularVelocityEmitted?.Invoke(Source.GetAngularVelocity()); }
public void Trigger() { var groundPoint = GetGroundPoint(); if (groundPoint != null) { OnInteractedUnityEvent.Invoke((Vector3)groundPoint); } }
/// <summary> /// Extracts the parts of the event data. /// </summary> /// <param name="eventData">The event data to extract from.</param> public virtual void Extract(ObjectDistanceComparator.EventData eventData) { if (!isActiveAndEnabled) { return; } DifferenceExtracted?.Invoke(eventData.difference); DistanceExtracted?.Invoke(eventData.distance); }
public virtual void Extract(ObjectDistanceComparator.EventData eventData) { if (eventData == null) { return; } DifferenceResult = eventData.CurrentDifference; DifferenceExtracted?.Invoke(DifferenceResult); DistanceResult = eventData.CurrentDistance; DistanceExtracted?.Invoke(DistanceResult); }
void Update() { if (projectile != null) { var vel = projectile.GetComponent <Rigidbody>().velocity; if (vel == Vector3.zero) { return; } var pos = projectile.transform.position; position = Mechanics.FinalProjectilePosition(pos, vel, yIntersect); OnPredict.Invoke(position); } }
private void Update() { // Poll Input // Grip bool leftGripIsPressed = false; if (_leftController.isValid) { _leftController.IsPressed(InputHelpers.Button.Grip, out leftGripIsPressed); } if (leftGripIsPressed != _leftGripPressedState) { _leftGripPressed.Invoke(leftGripIsPressed); _leftGripPressedState = leftGripIsPressed; } bool rightGripIsPressed = false; if (_rightController.isValid) { _rightController.IsPressed(InputHelpers.Button.Grip, out rightGripIsPressed); } if (rightGripIsPressed != _lastRightGripIsPressed) { _rightGripPressed.Invoke(rightGripIsPressed); _lastRightGripIsPressed = rightGripIsPressed; } // Polling velocity requires the node states... Unity is weird List <XRNodeState> nodes = new List <XRNodeState>(); InputTracking.GetNodeStates(nodes); foreach (XRNodeState ns in nodes) { if (ns.nodeType == XRNode.LeftHand) { ns.TryGetVelocity(out _leftVelocity); } if (ns.nodeType == XRNode.RightHand) { ns.TryGetVelocity(out _rightVelocity); } } LeftVelocityUpdate.Invoke(_leftVelocity); RightVelocityUpdate.Invoke(_rightVelocity); }
/// <summary> /// Extracts the play area dimensions. /// </summary> /// <returns>The extracted play area dimensions.</returns> public virtual Vector3 Extract() { if (!isActiveAndEnabled) { return(Result); } if (Boundary.TryGetDimensions(out Vector3 dimensions)) { Result = dimensions; Extracted?.Invoke(Result); } else { Failed?.Invoke(); } return(Result); }
/*AUTO SCRIPT*/ /*AUTO SCRIPT*/ public override void Invoke() /*AUTO SCRIPT*/ { /*AUTO SCRIPT*/ onInvoke.Invoke(value); /*AUTO SCRIPT*/ }
private void Awake() { PositionEmmit.Invoke(transform.position); }
public void ManualUpdate() { GridCell selected; Vector3 point; Vector3 mousePos = Input.mousePosition; Ray ray = camera.ScreenPointToRay(mousePos); RaycastHit[] hits = Physics.RaycastAll(ray); bool isInCell = false; if (Input.GetMouseButtonDown(0)) { if (CheckGridCell(hits, out selected)) { onDownCell.Invoke(selected); #if UNITY_EDITOR DrawGizmoCell(selected, gizmoDownColor, 0.75f); #endif isInCell = true; } if (CheckGridPoint(hits, out point)) { onDown.Invoke(point); Color pointColor = isInCell ? gizmoDownColor : gizmoFailColor; #if UNITY_EDITOR DrawGizmoPoint(point, Color.Lerp(pointColor, Color.black, 0.35f), 0.5f); #endif } } else if (Input.GetMouseButton(0)) { if (CheckGridCell(hits, out selected)) { onDragCell.Invoke(selected); #if UNITY_EDITOR DrawGizmoCell(selected, gizmoDragColor); #endif isInCell = true; } if (CheckGridPoint(hits, out point)) { onDrag.Invoke(point); Color pointColor = isInCell ? gizmoDragColor : gizmoFailColor; #if UNITY_EDITOR DrawGizmoPoint(point, Color.Lerp(pointColor, Color.black, 0.35f)); #endif } } else if (Input.GetMouseButtonUp(0)) { if (CheckGridCell(hits, out selected)) { onUpCell.Invoke(selected); #if UNITY_EDITOR DrawGizmoCell(selected, gizmoUpColor, 0.75f); #endif isInCell = true; } if (CheckGridPoint(hits, out point)) { onUp.Invoke(point); Color pointColor = isInCell ? gizmoUpColor : gizmoFailColor; #if UNITY_EDITOR DrawGizmoPoint(point, Color.Lerp(pointColor, Color.black, 0.35f), 0.5f); #endif } } else { if (CheckGridCell(hits, out selected)) { onOverCell.Invoke(selected); #if UNITY_EDITOR DrawGizmoCell(selected, gizmoUpColor); #endif isInCell = true; } if (CheckGridPoint(hits, out point)) { onOver.Invoke(point); Color pointColor = isInCell ? gizmoOverColor : gizmoFailColor; #if UNITY_EDITOR DrawGizmoPoint(point, Color.Lerp(pointColor, Color.black, 0.35f)); #endif } } }
private void OnScaleChanged(Vector3 scale) { _scaleChanged.Invoke(scale); }
public override void OnEventRaised(Vector3 data) { _response.Invoke(data); }
protected void CallEvent() { OnJoystickMoved?.Invoke(new Vector3(Horizontal, 0f, Vertical)); }
public void GenerateDirectionEvent() { onDirectionGenerated.Invoke(GenerateNormalisedDirection()); }
public void GeneratePositionEvent() { onPositionGenerated.Invoke(GeneratePositionInVolumes()); }
protected override void CastedHandler(object data) { responce?.Invoke((Vector3)data); }
private void RaiseUpdatedVector3(Vector3 value) { // Debug.Log("RaiseUpdatedVector3 " + value); _updatedVector3.Invoke(value); }
public override void OnEventRaised(params object[] parameters) { Response.Invoke((Vector3)parameters[0]); }