bool FocusButtonPressed() { //if (NInput.GetKey(KeyCode.Backslash)) //lastInput = "\\"; return(NInput.GetKeyDown(KeyCode.T) || NInput.GetKey(KeyCode.Backslash)); }
void Update() { if (!isLocalPlayer) { return; } float iH = NInput.GetAxis("Horizontal"); float iV = NInput.GetAxis("Vertical"); speedMult = NInput.GetKey(KeyCode.LeftShift) ? runSpeedMult : walkSpeedMult; Vector3 iVec = new Vector3(iH, 0, iV); Vector3 move = iVec.normalized * speedSlope.Evaluate(iVec.magnitude) * speedMult;// * Time.deltaTime; move = transform.forward * move.z + transform.right * move.x; // vertical speed if (controller.isGrounded) { vSpeed = 0; if (NInput.GetKeyDown(KeyCode.Space)) { vSpeed = 8; } } vSpeed -= gravity * Time.deltaTime; vSpeed = Mathf.Clamp(vSpeed, -54, 54); move.y = vSpeed; //float x = speedSlope.Evaluate(Mathf.Abs(f)) * Time.deltaTime; //float y = speedSlope.Evaluate(Input.GetAxis("Vertical")) * Time.deltaTime; controller.Move(move * Time.deltaTime); // MOUSELOOK float rotX = NInput.GetAxis("Mouse X") * mouseSensitivity; float rotY = NInput.GetAxis("Mouse Y") * mouseSensitivity; totalX += rotX; totalY += rotY; totalY = Mathf.Clamp(totalY, -85, 85); Quaternion yQuaternion = Quaternion.AngleAxis(totalY, Vector3.left); Quaternion xQuaternion = Quaternion.AngleAxis(totalX, Vector3.up); head.localRotation = yQuaternion; transform.localRotation = xQuaternion; if (NInput.GetKeyDown(KeyCode.B)) { CmdBoxSpawn(); } }
// Update is called once per frame void Update() { if (!doMove) { return; } if (NInput.TouchBegan()) { Joystick.SetPivot(); PlayerPos = Player.localPosition; } if (NInput.TouchEnded()) { } if (NInput.IsScreenTouched()) { Speed += Time.deltaTime * Acceleration; Joystick.Update(); } else { Speed -= Time.deltaTime * Acceleration * 2f; } Speed = Mathf.Clamp(Speed, MinSpeed, !IsInFastLane() ? MaxSpeed : MaxSpeed + FewerBoost); Dist += Time.deltaTime * Speed; if (Dist >= Track.length) { dist = 30f; } SetPositionOnDistance(); if (isFewer) { Trail.emitting = true; if (Time.time > NextSpeedUp) { FewerBoost += 10f; Speed += 10f; NextSpeedUp = Time.time + 2f; } } else { FewerBoost = 20f; Trail.emitting = false; } }
void UpdateRaycast() { hoverCollider = null; crosshair.SetActive(false); RaycastHit hit; Physics.Raycast(raycastFrom.position, raycastFrom.forward, out hit, raycastDistance); if (!hit.collider) { return; } hoverCollider = hit.collider; // interactable Interactable interactable = hit.collider.GetComponent <Interactable>(); if (interactable) { if (NInput.GetMouseButtonDown(1)) { if (isServer) { interactable.Act(); } else { CmdInteract(interactable.gameObject); } } } if (interactable is Item) { if (NInput.GetMouseButtonDown(1)) { Item item = interactable as Item; Take(item); } } if (interactable) { crosshair.SetActive(true); } }
void Start() { active = this; Karar.addListener(this); ZV1.Action.Kind[] ary = (ZV1.Action.Kind[])Enum.GetValues(typeof(ZV1.Action.Kind)); nor_out = new Output[ary.Length]; for (int i = 0; i < 4; i++) { nor_out[i] = generateOut(ary[i]); nor_out[i].setPosition(outputs.position + (new Vector3(0, 2.25f, 0) - new Vector3(0, 1.5f * i, 0))); } nor_in = generateIn(); }
public InputMatrix(int count) { inputs = new NInput[count]; oldInputsActive = new float[count]; inputsMotor = new float[count]; for (int i = 0; i < count; i++) { inputs[i] = new NInput(); oldInputsActive[i] = 0.0f; inputsMotor[i] = 0.0f; } upSubZone = null; }
public override int GetHashCode() { int hash = 1; if (Engine.Length != 0) { hash ^= Engine.GetHashCode(); } if (Normalization.Length != 0) { hash ^= Normalization.GetHashCode(); } if (NInput != 0) { hash ^= NInput.GetHashCode(); } if (NOutput != 0) { hash ^= NOutput.GetHashCode(); } if (LearningRate != 0D) { hash ^= LearningRate.GetHashCode(); } if (BatchSize != 0) { hash ^= BatchSize.GetHashCode(); } if (EpochSize != 0) { hash ^= EpochSize.GetHashCode(); } if (Optimizer.Length != 0) { hash ^= Optimizer.GetHashCode(); } if (LossFunc.Length != 0) { hash ^= LossFunc.GetHashCode(); } hash ^= maxV_.GetHashCode(); hash ^= minV_.GetHashCode(); hash ^= meanV_.GetHashCode(); hash ^= stdV_.GetHashCode(); hash ^= layers_.GetHashCode(); return(hash); }
void Update() { if (!isLocalPlayer) { return; } UpdateHand(); UpdateRaycast(); UpdateDescription(); if (NInput.GetMouseButtonDown(0)) { UseOnce(); } if (NInput.GetMouseButton(0)) { Use(); } if (NInput.GetMouseButtonUp(0)) { triggerDown = false; } if (NInput.GetMouseButtonDown(1)) { StartAim(); } if (NInput.GetMouseButtonUp(1)) { EndAim(); } if (NInput.GetKeyDown(KeyCode.Q)) { Drop(); } mouseSpeed = new Vector3(NInput.GetAxis("Mouse X"), NInput.GetAxis("Mouse Y"), 0); }
private void Update() { if (NInput.TouchBegan()) { Joystick.SetPivot(); PlayerPos = Rb.position; Input = true; } CarManager.CountFlips(); if (NInput.TouchEnded()) { Input = false; } UIManager.Progress(transform.position.z / LevelGenerator.path.end.z); }