void OnGUI() { type = (VRCSDK2.VRCPlayerModFactory.PlayerModType)EditorGUILayout.EnumPopup("Mods", type); if (GUILayout.Button("Add Mod")) { VRCSDK2.VRCPlayerMod mod = VRCSDK2.VRCPlayerModFactory.Create(type); myTarget.AddMod(mod); addModCallback(); } }
public void RemoveMod(VRCPlayerMod mod) { foreach (VRCPlayerMod playerMod in playerMods) { if (playerMod.name == mod.name) { playerMods.Remove(playerMod); break; } } }
public void AddMod(VRCPlayerMod mod) { bool flag = false; foreach (VRCPlayerMod playerMod in playerMods) { if (playerMod.Equals(mod)) { flag = true; } } if (!flag) { playerMods.Add(mod); } }