コード例 #1
0
    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);
    }
コード例 #2
0
        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));
        }
コード例 #3
0
ファイル: MonkeyMenuItems.cs プロジェクト: malering/ET
 public static void SelectSiblings()
 {
     SelectionUtilities.SelectSiblings();
 }
コード例 #4
0
ファイル: MonkeyMenuItems.cs プロジェクト: malering/ET
 public static void SelectParent()
 {
     SelectionUtilities.SelectParent();
 }
コード例 #5
0
ファイル: MonkeyMenuItems.cs プロジェクト: malering/ET
 public static void UnSelectAll()
 {
     SelectionUtilities.ClearSelection();
 }