コード例 #1
0
        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);
            }
        }
コード例 #2
0
 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
 }