Advertisement
Guest User

Untitled

a guest
Sep 18th, 2019
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. //in LuaEventOW.cs
  2.  
  3. private GameObject ob;
  4.  
  5. [CYFEventFunction]
  6. public void SetAsObject(string name)
  7. {
  8. Debug.Log("yaaaaaasssssss!");
  9. ob = GameObject.Find(name);
  10. if (ob != null)
  11. {
  12. Debug.Log("victory~");
  13. appliedScript.Call("CYFEventNextCommand");
  14. return;
  15. }
  16.  
  17. throw new CYFException("Event.SetAsObject: The event \"" + name + "\" doesn't exist.");
  18. }
  19.  
  20. [CYFEventFunction]
  21. public void IsObjectVisible(bool toggle) {
  22. Debug.Log("visibleeeeeeeeeeee");
  23. if (ob != null)
  24. {
  25. ob.SetActive(toggle);
  26. appliedScript.Call("CYFEventNextCommand");
  27. return;
  28. }
  29.  
  30. throw new CYFException("Event.IsObjectVisible: The event was set to call an invalid object. Did you forget SetAsObject(string name)?");
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement