Last active
November 23, 2018 19:20
-
-
Save pacoelayudante/74ceebe2be0cc2f8268fa6c6d6234daf to your computer and use it in GitHub Desktop.
Idea Variable Linker Unity
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
algo que vincule varias fields de un mismo tipo, cuando se modifica le avisa a les demas... | |
tiene zarpado peligro de entrar en un loop recursivo! | |
UnityEvent OnChange | |
UnityEvent<T> Check | |
T valor; | |
Suscribir ( (Color set)=> spriteRenderer.color = set , ()=> return spriteRenderer.color ); | |
T Valor { | |
set { | |
valor = nuevoValor; | |
OnChange.Invoke(nuevoValor); | |
} | |
} | |
loop { | |
foreach (Check){ | |
if (esteCheck.Invoke()!=valor) { | |
Valor = esteCheck.Invoke();//aca si suceden varios cambios a la vez toma el primero | |
break; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment