/// <summary> /// (Cross-Game compatible) Get the personal mod directory for this specific mod. Useful for keeping this mod's files seperate from other mods. Example: "BloonsTD6/Mods/BloonsTD6 Mod Helper/settings.txt" /// </summary> /// <param name="bloonsMod"></param> /// <param name="createIfNotExists">Create the mod's directory if it doesn't exist yet?</param> /// <returns></returns> public static string GetModDirectory(this BloonsMod bloonsMod, bool createIfNotExists = true) { string path = $"{Environment.CurrentDirectory}\\Mods\\{bloonsMod.GetModName()}"; if (createIfNotExists) { Directory.CreateDirectory(path); } return(path); }
private void PopulateModListItems(BloonsMod bloonsMod, int index) { var item = GameObject.Instantiate(modListItem, modList); var button = item.GetComponentInChildren <Button>(); button.onClick.AddListener(() => PopulateModOptions(bloonsMod)); button.GetComponentInChildren <Text>().text = bloonsMod.GetModName(); var height = button.GetComponent <RectTransform>().rect.height; item.gameObject.transform.position = new Vector3(item.gameObject.transform.position.x, item.gameObject.transform.position.y - (index * 65)); //(index * height)); item.Show(); }
/// <summary> /// (Cross-Game compatible) Get the personal mod directory for this specific mod. Useful for keeping this mod's files seperate from other mods. Example: "BloonsTD6/Mods/BloonsTD6 Mod Helper/settings.txt" /// </summary> /// <param name="bloonsMod"></param> /// <returns></returns> public static string GetModDirectory(this BloonsMod bloonsMod) { return($"{Environment.CurrentDirectory}\\Mods\\{bloonsMod.GetModName()}"); }