Advertisement
Diamond32_Tutoriales

CHANGE VAR FIX

Oct 17th, 2022
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.74 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using ESX.PROCESSOR;
  5. using GraphProcessor;
  6.  
  7.  
  8. [System.Serializable, NodeMenuItem("ESXBehaviour/Insertar valor en una variable (local)")]
  9. public class _CambiarVariableLocal : LinearConditionalNode
  10. {
  11.  
  12. [HideInInspector] public MonoBehaviour script;
  13.  
  14. [Input(name = "Nombre de la variable"), SerializeField]
  15. public string var;
  16.  
  17. [Input(name = "Valor nuevo")]
  18. public object valor;
  19.  
  20. public override string name => "Insertar valor en una variable (local)";
  21.  
  22. protected override void Process()
  23. {
  24. GraphBehaviour behaviour = script.GetComponent<GraphBehaviour>();
  25. behaviour.graph.SetParameterValue(var, valor);
  26. }
  27. }
  28.  
  29. [System.Serializable, NodeMenuItem("ESXBehaviour/Obtener valor de una variable (local)")]
  30. public class _ObtenerVariableLocal : LinearConditionalNode
  31. {
  32.  
  33. [HideInInspector] public MonoBehaviour script;
  34.  
  35. [Input(name = "Nombre de la variable"), SerializeField]
  36. public string var;
  37.  
  38. [Output(name = "Valor obtenido")]
  39. public object valor;
  40.  
  41. public override string name => "Obtener valor de una variable (local)";
  42.  
  43. protected override void Process()
  44. {
  45. GraphBehaviour behaviour = script.GetComponent<GraphBehaviour>();
  46. var getted = behaviour.graph.GetParameterValue(var);
  47. valor = getted;
  48. }
  49. }
  50.  
  51. #if PHOTON_UNITY_NETWORKING
  52. [System.Serializable, NodeMenuItem("ESXBehaviour/Insertar valor en una variable (local pun 2)")]
  53. public class _CambiarVariableLocal_Pun2 : LinearConditionalNode
  54. {
  55.  
  56. [HideInInspector] public MonoBehaviour script;
  57.  
  58. [Input(name = "Nombre de la variable"), SerializeField]
  59. public string var;
  60.  
  61. [Input(name = "Valor nuevo")]
  62. public object valor;
  63.  
  64. public override string name => "Insertar valor en una variable (local pun 2)";
  65.  
  66. protected override void Process()
  67. {
  68. Pun2_GraphBehaviour behaviour = script.GetComponent<Pun2_GraphBehaviour>();
  69. behaviour.graph.SetParameterValue(var, valor);
  70. }
  71. }
  72.  
  73. [System.Serializable, NodeMenuItem("ESXBehaviour/Obtener valor de una variable (local pun 2)")]
  74. public class _ObtenerVariableLocal_Pun2 : LinearConditionalNode
  75. {
  76.  
  77. [HideInInspector] public MonoBehaviour script;
  78.  
  79. [Input(name = "Nombre de la variable"), SerializeField]
  80. public string var;
  81.  
  82. [Output(name = "Valor obtenido")]
  83. public object valor;
  84.  
  85. public override string name => "Obtener valor de una variable (local pun 2)";
  86.  
  87. protected override void Process()
  88. {
  89. Pun2_GraphBehaviour behaviour = script.GetComponent<Pun2_GraphBehaviour>();
  90. var getted = behaviour.graph.GetParameterValue(var);
  91. valor = getted;
  92. }
  93. }
  94. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement