protected virtual void OnConfigReady(StdConfig conf) { if (ConfigReady != null) { ConfigReady(this, conf); } }
//use configPath to interpret config file and fill out a StdConfig object, //pass StdConfig in event to listeners public void ReadConfigFile() { TextAsset configData = (TextAsset)Resources.Load("config"); string fileData = configData.text; string[] lines = fileData.Split('\n'); string[] data; StdConfig test = new StdConfig(); foreach (string line in lines) { data = (line.Trim()).Split(','); test.AddParameter(data[0], data[1]); } OnConfigReady(test); }
public void OnConfigReady(object source, StdConfig conf) { Debug.Log("heard configready event!"); }