public override void BEFunction(BETargetObject targetObject, BEBlock beBlock) { switch (beBlock.BeInputs.stringValues[0]) { case "ArrowUp": beJoyButton = BeController.beJoystick.arrowUpButton; break; case "ArrowLeft": beJoyButton = BeController.beJoystick.arrowLeftButton; break; case "ArrowDown": beJoyButton = BeController.beJoystick.arrowDownButton; break; case "ArrowRight": beJoyButton = BeController.beJoystick.arrowRightButton; break; case "ButtonA": beJoyButton = BeController.beJoystick.buttonA; break; case "ButtonB": beJoyButton = BeController.beJoystick.buttonB; break; default: beJoyButton = null; break; } if (beJoyButton.isPressed) { beBlock.BeBlockGroup.isActive = true; BeController.PlayNextInside(beBlock); } else { beBlock.BeBlockGroup.isActive = false; BeController.StopGroup(beBlock.BeBlockGroup); } }
public override void BEFunction(BETargetObject targetObject, BEBlock beBlock) { try { key = (KeyCode)System.Enum.Parse(typeof(KeyCode), beBlock.BeInputs.stringValues[0]); } catch (Exception e) { Debug.Log("probably still initializing"); Debug.Log(e); } if (Input.GetKey(key)) { beBlock.BeBlockGroup.isActive = true; BeController.PlayNextInside(beBlock); } else if (!Input.GetKey(key)) { beBlock.BeBlockGroup.isActive = false; BeController.StopGroup(beBlock.BeBlockGroup); } }