private void UpdateDefinitions(VR_SDK targetSDK) { targetScript.SetCurrentSDKViaEditor(targetSDK); startSDKIndex = (int)targetScript.CurrentSDK; if (targetSDK == VR_SDK.None) { GlobalDefinitionsManager.RemoveDefinitions(OCULUS_VR_DEFINITION, STEAM_VR_DEFINITION); OnUpdateDefinitions(targetSDK); return; } string defString = GetDefString(targetSDK); if (GlobalDefinitionsManager.DefinitionExits(OCULUS_VR_DEFINITION) || GlobalDefinitionsManager.DefinitionExits(STEAM_VR_DEFINITION)) { List <string> defList = GlobalDefinitionsManager.GetCurrentDefinitios(); for (int n = 0; n < defList.Count; n++) { string def = defList[n].Replace(" ", ""); //remove all sdk defines if (def == STEAM_VR_DEFINITION || def == OCULUS_VR_DEFINITION) { defList.RemoveAt(n); n--; } } defList.Add(defString); GlobalDefinitionsManager.WriteDefinitions(defList); } else { GlobalDefinitionsManager.CreateAndWriteDefinition(defString); } OnUpdateDefinitions(targetSDK); }
private VR_SDK GetCurrentEnableSDK() { List <string> defList = GlobalDefinitionsManager.GetCurrentDefinitios(); for (int n = 0; n < defList.Count; n++) { string def = defList[n].Replace(" ", ""); if (def == STEAM_VR_DEFINITION) { return(VR_SDK.Steam_VR); } else if (def == OCULUS_VR_DEFINITION) { return(VR_SDK.Oculus); } } return(VR_SDK.None); }