32 lines
774 B
C#
32 lines
774 B
C#
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;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|