Advertisement
Guest User

Untitled

a guest
Jul 19th, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.34 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 GraphScript : FlowGraphScript
  32. {
  33. private EventHook onMouseInputHook;
  34. private Action<EmptyEventArgs> onMouseInputHandler;
  35. private EventHook startHook;
  36. private Action<EmptyEventArgs> startHandler;
  37. private EventHook updateHook;
  38. private Action<EmptyEventArgs> updateHandler;
  39.  
  40. public GraphScript(IMachineScript machineScript) : base(machineScript) { }
  41.  
  42. public override FlowGraphData graphData
  43. {
  44. get => _graphData;
  45. set
  46. {
  47. _graphData = value;
  48. }
  49. }
  50.  
  51. public void OnMouseInput()
  52. {
  53. if (Input.GetMouseButtonDown((int)MouseButton.Left))
  54. {
  55. Debug.Log("test");
  56. }
  57. }
  58.  
  59. public void Start() { }
  60.  
  61. public void Update()
  62. {
  63. gameObject.transform.Rotate(new Vector3(0f, Variables.Object(gameObject).Get("speed").ConvertTo<float>(), 0f));
  64. }
  65.  
  66. public override void StartListening()
  67. {
  68. base.StartListening();
  69. onMouseInputHook = new EventHook("Update", machineScript);
  70. onMouseInputHandler = args => OnMouseInput();
  71. EventBus.Register(onMouseInputHook, onMouseInputHandler);
  72. startHook = new EventHook("Start", machineScript);
  73. startHandler = args => Start();
  74. EventBus.Register(startHook, startHandler);
  75. updateHook = new EventHook("Update", machineScript);
  76. updateHandler = args => Update();
  77. EventBus.Register(updateHook, updateHandler);
  78. }
  79.  
  80. public override void StopListening()
  81. {
  82. base.StopListening();
  83. EventBus.Unregister(onMouseInputHook, onMouseInputHandler);
  84. onMouseInputHandler = null;
  85. EventBus.Unregister(startHook, startHandler);
  86. startHandler = null;
  87. EventBus.Unregister(updateHook, updateHandler);
  88. updateHandler = null;
  89. }
  90. }
  91. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement