public override void Init() { try { using (var file = new StreamReader(PluginFolder(INSTRUCTIONS))) { Manual = MD2Unity.Parse(file); if (Manual.NoTitle) { Manual.Title = "TCA Reference Manual"; } } } catch (Exception ex) { Utils.Log("Error loading {} file:\n{}", PluginFolder(INSTRUCTIONS), ex); } InputDeadZone *= InputDeadZone; //it is compared with the sqrMagnitude //init all module configs var mt = typeof(TCAModule.ModuleConfig); foreach (var fi in GetType().GetFields()) { if (!fi.FieldType.IsSubclassOf(mt)) { continue; } var method = fi.FieldType.GetMethod("Init"); if (method == null) { continue; } method.Invoke(fi.GetValue(this), null); } }
public override void Init() { try { using (var file = new StreamReader(PluginFolder(INSTRUCTIONS))) { Manual = MD2Unity.Parse(file); if (Manual.NoTitle) { Manual.Title = "TCA Reference Manual"; } } } catch (Exception ex) { Utils.Log("Error loading {} file:\n{}", PluginFolder(INSTRUCTIONS), ex); } InputDeadZone *= InputDeadZone; //it is compared with the sqrMagnitude }