Ejemplo n.º 1
0
 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);
     }
 }
Ejemplo n.º 2
0
        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);
        }