public bool IsWithinSelectionBounds(GameObject gameObject) { if (!sc.GetComponent <StrategyCamera>().dragging) { return(false); } var camera = Camera.main; var viewportBounds = SelectionUtilities.GetViewportBounds(camera, sc.GetComponent <StrategyCamera>().mousePosition1, Input.mousePosition); if (viewportBounds.Contains(camera.WorldToViewportPoint(gameObject.transform.position))) { isSelected = true; return(true); } if (!viewportBounds.Contains(camera.WorldToViewportPoint(gameObject.transform.position))) { isSelected = false; return(false); } return(false); }
public static string GetModBuildFolder() { string compileLocation = null; if (compileLocation == null) { if (!string.IsNullOrEmpty(BuildScreen.BuildSettings?.BuildLocation)) { compileLocation = BuildScreen.BuildSettings.BuildLocation; } else { compileLocation = SelectionUtilities.SelectFolder("Select where you want to place the finished mod", ""); if (compileLocation == null) { throw new Exception("An invalid path specified for building the mod"); } } } return(PathUtilities.AddSlash(compileLocation)); }
public static void SelectSiblings() { SelectionUtilities.SelectSiblings(); }
public static void SelectParent() { SelectionUtilities.SelectParent(); }
public static void UnSelectAll() { SelectionUtilities.ClearSelection(); }