Пример #1
0
        /// <summary>
        /// If the user holds a raycast down for X seconds on a clamp, it should destroy the clamp
        /// </summary>
        public void MonitorInput()
        {
            if (ClampManager.PressedCancel)
            {
                ResetInput();
            }

            if (ClampManager.PressedToggleDestroy)
            {
                holdCount++;

                // If we've held the button long enough to destory, color caps red until user releases button
                if (holdCount > ClampManager.destroyCount && !powerClick)
                {
                    SwitchCaps(false);
                }
                else if (powerClick)
                {
                    SwitchCaps(true);
                }
            }
            else
            {
                CheckInput();
            }

            float power = ClampManager.PowerModifier;

            // If clamp power is modified while the user holds a click, don't let the click also toggle/destroy the clamp
            if (power != 0 && !powerClick)
            {
                powerClick = true;
            }

            ClampPower += power;
            Math.Clamp(ClampPower, MinPower, MaxPower);
        }
Пример #2
0
 public void SwitchVisualMesh(double inflation)
 {
     inflation       = Math.Clamp(inflation, 1, 5);
     VisualInflation = inflation;
 }