Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.99 KB | None | 0 0
  1. //--------------------------------------------------------------
  2. // _______ _____ __ ________
  3. // | ___ \ / \ | | |___ ___|
  4. // | | \ | / ___ \ | | / /
  5. // | |___/ / / / \ \ | | / /_
  6. // | | \ \ \ \___/ / | | /_ /
  7. // | |___/ | \ / | |____ | /
  8. // |_______/ \_____/ |_______| |/
  9. //
  10. // V I S U A L S C R I P T I N G
  11. //--------------------------------------------------------------
  12. //
  13. // THIS FILE IS AUTO-GENERATED.
  14. //
  15. // ANY CHANGES WILL BE LOST NEXT TIME THIS SCRIPT IS GENERATED.
  16. //
  17. //--------------------------------------------------------------
  18. #pragma warning disable 162, 168, 219, 429
  19.  
  20. using Bolt;
  21. using Ludiq;
  22. using Ludiq.Bolt;
  23. using System;
  24. using System.Collections;
  25. using System.Collections.Generic;
  26. using System.Linq;
  27. using UnityEngine;
  28.  
  29. namespace Bolt.Generated
  30. {
  31. public class TestGraphScript : FlowGraphScript
  32. {
  33. private EventHook onKeyboardInputHook;
  34. private Action<EmptyEventArgs> onKeyboardInputHandler;
  35. private EventHook startHook;
  36. private Action<EmptyEventArgs> startHandler;
  37.  
  38. public TestGraphScript(IMachineScript machineScript) : base(machineScript) { }
  39.  
  40. public override FlowGraphData graphData
  41. {
  42. get => _graphData;
  43. set
  44. {
  45. _graphData = value;
  46. }
  47. }
  48.  
  49. public void OnKeyboardInput()
  50. {
  51. if (Input.GetKeyDown(KeyCode.Space))
  52. {
  53. var load = ES3.Load<string>("myString");
  54.  
  55. Debug.Log(load);
  56. }
  57. }
  58.  
  59. public void Start()
  60. {
  61. ES3.Save<string>("myString", "this is a string");
  62. }
  63.  
  64. public override void StartListening()
  65. {
  66. base.StartListening();
  67. onKeyboardInputHook = new EventHook("Update", machineScript);
  68. onKeyboardInputHandler = args => OnKeyboardInput();
  69. EventBus.Register(onKeyboardInputHook, onKeyboardInputHandler);
  70. startHook = new EventHook("Start", machineScript);
  71. startHandler = args => Start();
  72. EventBus.Register(startHook, startHandler);
  73. }
  74.  
  75. public override void StopListening()
  76. {
  77. base.StopListening();
  78. EventBus.Unregister(onKeyboardInputHook, onKeyboardInputHandler);
  79. onKeyboardInputHandler = null;
  80. EventBus.Unregister(startHook, startHandler);
  81. startHandler = null;
  82. }
  83. }
  84. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement