void Update()
 {
     if (DebugInput.GetKeyDown(modeSwitchKey))
     {
         debugMode = (DebugMode)(((int)debugMode + 1) % NUM_MODES);
     }
 }
Beispiel #2
0
    void Update()
    {
        if (DebugInput.GetKey(KeyCode.LeftShift) && DebugInput.GetKeyDown(KeyCode.G))
        {
            ToggleNoClip();
        }

        if (noClipOn)
        {
            if (DebugInput.GetKeyDown(KeyCode.LeftShift))
            {
                desiredSpeed = (desiredSpeed == sprintSpeed) ? moveSpeed : sprintSpeed;
            }
            else if (DebugInput.GetKeyDown(KeyCode.LeftControl))
            {
                desiredSpeed = (desiredSpeed == slowMoveSpeed) ? moveSpeed : slowMoveSpeed;
            }

            Vector2 moveInput = input.LeftStick;

            Vector3 moveDirection = playerCamera.forward * moveInput.y + playerCamera.right * moveInput.x;

            speed = Mathf.Lerp(speed, desiredSpeed, Time.deltaTime * 6f);
            float   middleMouseScroll = Input.mouseScrollDelta.y;
            Vector3 verticalScroll    = transform.up * (middleMouseScroll * middleMouseVerticalSpeed);

            transform.position += (verticalScroll + moveDirection) * (Time.deltaTime * speed);
        }
    }
 // Update is called once per frame
 void Update()
 {
     // DEBUG
     if (DebugInput.GetKey(KeyCode.LeftShift) && DebugInput.GetKeyDown("o"))
     {
         StartCoroutine(DoorOpen());
     }
 }
Beispiel #4
0
 void Update()
 {
     if (DebugInput.GetKey(KeyCode.LeftShift) && DebugInput.GetKeyDown(KeyCode.B))
     {
         ToggleDebugMode();
     }
     if (DebugInput.GetKey(KeyCode.LeftShift) && DebugInput.GetKeyDown(KeyCode.V))
     {
         ToggleDoubleSidedEdges();
     }
 }
    void Update()
    {
        if (DebugInput.GetKey(KeyCode.LeftShift) && DebugInput.GetKeyDown(KeyCode.F5))
        {
            limitFramerate = !limitFramerate;
        }

        if (limitFramerate)
        {
            WasteTime();
        }
    }
Beispiel #6
0
        // Update is called once per frame
        void Update()
        {
            if (state == State.Depowered && mainPower.state == PowerTrail.PowerTrailState.powered)
            {
                state.Set(State.Powering);
            }

            if (DebugInput.GetKeyDown(KeyCode.Alpha0))
            {
                state.Set((State)(2 - (int)state.state));
            }

            UpdateMiniSpotlights();
            UpdatePuzzleIsSolvedIndicator();
            UpdateDissolveLaser();
            UpdateGridColors();
        }
        // Update is called once per frame
        void Update()
        {
            if (!DEBUG)
            {
                return;
            }

            if (DebugInput.GetKey(KeyCode.LeftShift) && DebugInput.GetKeyDown(KeyCode.R) && !inBridgeRiseCoroutine)
            {
                ResetBridgePiecePositions();
            }

            else if (DebugInput.GetKeyDown(KeyCode.R) && !inBridgeRiseCoroutine)
            {
                StartCoroutine(BridgeRise());
            }
        }
 private void Update()
 {
     if (DebugInput.GetKeyDown(KeyCode.O))
     {
         adminObjectShow = !adminObjectShow;
         if (adminObjectShow)
         {
             Debug.Log("shown object overlay", this);
         }
         else
         {
             Debug.Log("hid object overlay", this);
         }
     }
     if (adminObjectShow && DebugInput.GetKeyDown(KeyCode.L))
     {
         mode = (mode + 1) % 2;
     }
 }
 private void Update()
 {
     if (DebugInput.GetKeyDown(KeyCode.O))
     {
         LocalDamageDisplay.adminObjectShow = !LocalDamageDisplay.adminObjectShow;
         if (!LocalDamageDisplay.adminObjectShow)
         {
             Debug.Log("hid object overlay", this);
         }
         else
         {
             Debug.Log("shown object overlay", this);
         }
     }
     if (LocalDamageDisplay.adminObjectShow && DebugInput.GetKeyDown(KeyCode.L))
     {
         LocalDamageDisplay.mode = (LocalDamageDisplay.mode + 1) % 2;
     }
 }
Beispiel #10
0
    void Update()
    {
        if (Time.timeScale == 0)
        {
            return;
        }

#if UNITY_EDITOR
        if (DEBUG && DebugInput.GetKeyDown("c"))
        {
            if (!isShaking)
            {
                Shake(2, 1, 0);
            }
            else
            {
                CancelShake();
            }
        }
#endif

        if (!isShaking)
        {
            if (totalOffsetApplied.magnitude > 0.001f)
            {
                Vector2 nextTotalOffsetApplied = Vector2.Lerp(totalOffsetApplied, Vector2.zero, returnToCenterLerpSpeed * Time.deltaTime);
                Vector2 offset = nextTotalOffsetApplied - totalOffsetApplied;
                transform.localPosition += new Vector3(offset.x, offset.y, 0);
                totalOffsetApplied       = nextTotalOffsetApplied;
            }
            else if (totalOffsetApplied.magnitude > 0f)
            {
                transform.localPosition -= new Vector3(totalOffsetApplied.x, totalOffsetApplied.y, 0);
                totalOffsetApplied       = Vector2.zero;
            }
        }
        else
        {
            if (timeShaking < duration)
            {
                float t = timeShaking / duration;

                intensity = isUsingCurve ? curve.Evaluate(t) * intensityMultiplier : Mathf.Lerp(startIntensity, endIntensity, t);
                Vector2 random = UnityEngine.Random.insideUnitCircle * intensity / 10f;
                Vector2 offset = Vector2.Lerp(Vector2.zero, -appliedOffset, t) + random;

                appliedOffset           += offset;
                transform.localPosition += new Vector3(offset.x, offset.y, 0);
                totalOffsetApplied      += offset;

                timeShaking += Time.deltaTime;
            }
            else
            {
                transform.localPosition -= new Vector3(appliedOffset.x, appliedOffset.y, 0);
                totalOffsetApplied      -= appliedOffset;

                isShaking = false;
            }
        }
    }