void OnSymbolsChanged(object sender, SymbolEventArgs e) { if(e.SymbolChain == string.Empty){ clear(); return; } char symbol = e.SymbolChain[e.SymbolChain.Length-1]; Panel sign = ResourceManager.CreateInstance<GameObject>("Symbols/Sign"+symbol).GetComponent<Panel>(); if(sign == null) EditorDebug.LogError("Sign " + symbol + " is unkown"); else{ symbols.Add(sign); sign.transform.parent = this.transform; sign.CreateElement(); sign.UpdateParent(); updateSymbolChain(); activeScreen.UpdateElement(); // Update Screeen because of new Objects } }
private void InvokeSymbolsChanged() { var handler = SymbolsChanged; if (handler == null) { return; } var e = new SymbolEventArgs(symbolChain); SymbolsChanged(this, e); }
// Event Handling private void OnSymbolChanged(object sender, SymbolEventArgs e) { if (string.IsNullOrEmpty(e.SymbolChain)) { DarkenSymbols(); return; } HighlightSymbols(e.SymbolChain); }