I wanna make a GenericMap that will be using from both codes and the properties panel.
But anytime I make a change inside the project, the properties panel refreshed and all of my settings lost.

How can I implement a GenericMap for Mapping properties?
My implementation:
GenericMap
const GenericMap = cc.Class({
InitMap(){
this.map = {};
/** WARNING!!! this.data MUST BE A [Pair<key, value>]
*/
for(let i = 0; i < this.data.length; i++)
{
this.map[this.data[i].key] = this.data[i].value;
}
},
Get(key){
return this.map[key];
}
});
module.exports = GenericMap;
SoundHolder
const SoundPair = cc.Class({
properties: {
key : "",
value : cc.AudioClip
}
});
const SoundMap = cc.Class({
extends : GenericMap,
properties : {
data : {
default: [],
type: [SoundPair]
}
}
});
var SoundHolder = cc.Class({
name: "SoundHolder",
extends : cc.Component,
properties: {
music : cc.AudioSource,
fx : cc.AudioSource,
sounds : SoundMap,
},
start() {
sounds.InitMap();
}
});
module.exports = SoundHolder;

