public void save(EnKeyUnits keyId) { var id = ((int)keyId).ToString(); PlayerPrefs.SetInt(id + ":type", (int)type); switch (type) { case EnDeviceType.axis: deviceAxis.save(id); break; case EnDeviceType.key: deviceKey.save(id); break; } }
public void load(EnKeyUnits keyId) { var id = ((int)keyId).ToString(); var typeId = id + ":type"; if (!PlayerPrefs.HasKey(typeId)) { return; } type = (EnDeviceType)PlayerPrefs.GetInt(typeId); switch (type) { case EnDeviceType.axis: deviceAxis.load(id); break; case EnDeviceType.key: deviceKey.load(id); break; } }