using System.IO; using Base; namespace Model { [ObjectEvent] public class ClientConfigComponentEvent : ObjectEvent, IAwake { public void Awake() { this.GetValue().Awake(); } } public class ClientConfigComponent : Component { public StartConfig Config { get; private set; } public void Awake() { string s = File.ReadAllText("./StartConfig.txt"); this.Config = MongoHelper.FromJson(s); } public override void Dispose() { if (this.Id == 0) { return; } base.Dispose(); this.Config.Dispose(); } } }