using UnityEngine; using UnityEngine.InputSystem; namespace SkyboxBlenderSpace { public class SpacebarClick2 : MonoBehaviour { public SkyboxBlender skyboxScript; bool isStopped; void Update() { if (Keyboard.current.spaceKey.wasPressedThisFrame) { skyboxScript.Blend(true); isStopped = false; } // stop blending if (Keyboard.current.eKey.wasPressedThisFrame) { if (isStopped) { skyboxScript.Blend(true); isStopped = false; } else { skyboxScript.Stop(); isStopped = true; } } } } }