protected void ReadConf(string conf_path) { try { conf = JSON.ReadConfig <AbilityConf>(Application.streamingAssetsPath + conf_path); } catch (Exception ex) { Debug.LogError("Can't read ability config. " + ex.Message); } }
public static object GetFromConf(AbilityConf conf, object[] constructor_params) { Type type = Type.GetType("game." + conf.name); if (type != null) { var instance = Activator.CreateInstance(type, constructor_params); return(instance); } return(null); }