public void LoadBinds(string json) { if (mActionNames == null || mActionNames.Length == 0) { Debug.LogWarning("No action config loaded. There will be no bindings!"); return; } List <Bind> keys = BindList.FromJSON(json); if (mBinds == null || mBinds.Length == 0) { Dictionary <int, BindData> binds = new Dictionary <int, BindData>(); foreach (Bind key in keys) { if (key != null && key.keys != null) { binds.Add(key.action, new BindData(key)); } } //set bindings mBinds = new BindData[actionCount]; foreach (KeyValuePair <int, BindData> pair in binds) { mBinds[pair.Key] = pair.Value; } //register input actions to localizer for (int i = 0; i < actionCount; i++) { Localize.instance.RegisterParam("input_" + i, OnTextParam); } } else { foreach (Bind key in keys) { if (key != null && key.keys != null) { if (mBinds[key.action] != null) { BindData bindDat = mBinds[key.action]; bindDat.ApplyKeys(key); } } } } }