Esempio n. 1
0
        /// <inheritdoc />
        public override void OnMouseover()
        {
            if (!open)
            {
                if (SelectionRect.Contains(Event.current.mousePosition))
                {
                    DrawGUI.DrawMouseoverEffect(SelectionRect, localDrawAreaOffset);
                }

                DrawGUI.Active.AddCursorRect(SelectionRect, MouseCursor.Link);
            }
        }
Esempio n. 2
0
        private void UpdateSizeSelection(SelectedSize selectedSize)
        {
            Xamarin.Forms.Shapes.Rectangle selectedRect = SmallRect;
            Xamarin.Forms.Shapes.Path      selectedCup  = SmallCup;
            switch (selectedSize)
            {
            case SelectedSize.small:
                selectedRect = SmallRect;
                selectedCup  = SmallCup;
                break;

            case SelectedSize.medium:
                selectedRect = MediumRect;
                selectedCup  = MediumCup;
                break;

            case SelectedSize.large:
                selectedRect = LargeRect;
                selectedCup  = LargeCup;
                break;
            }

            // clear the selections
            SolidColorBrush unselectedBackground = new SolidColorBrush(Color.FromHex("F8F8F8"));
            SolidColorBrush unselectedStroke     = new SolidColorBrush(Color.FromHex("E1E1E1"));
            SolidColorBrush selectedBackground   = new SolidColorBrush(Color.FromHex("E5F0EC"));
            SolidColorBrush selectedStroke       = new SolidColorBrush(Color.FromHex("1B714B"));

            SmallRect.Fill    = unselectedBackground;
            SmallRect.Stroke  = unselectedStroke;
            MediumRect.Fill   = unselectedBackground;
            MediumRect.Stroke = unselectedStroke;
            LargeRect.Fill    = unselectedBackground;
            LargeRect.Stroke  = unselectedStroke;
            SmallCup.Stroke   = unselectedStroke;
            MediumCup.Stroke  = unselectedStroke;
            LargeCup.Stroke   = unselectedStroke;

            // move the selectionRectangle
            SelectionRect.LayoutTo(selectedRect.Bounds, 100, Easing.CubicInOut);

            // update the background colors
            selectedRect.Fill = selectedBackground;

            // update the stroke on the cup
            selectedCup.Stroke = selectedStroke;
        }
Esempio n. 3
0
    public AssetViewerInfo.ClickType Click(EventType eventType, int clickCount, Vector2 mousePosition, out string folderName)
    {
        AssetViewerInfo.ClickType clickType = ClickType.NONE;
        folderName = string.Empty;

        if (SelectionRect.Contains(mousePosition))
        {
            folderName = FolderName;
            //	if it has we set it as selected and update the Selection.activeobject so its visible in the inspector
            Object obj = AssetDatabase.LoadAssetAtPath(FileSystemInfo.FullName.RemoveProjectPath(), typeof(Object));
            if (obj != null)
            {
                Selection.activeObject = obj;
            }

            //	 a user double clicks on the folder
            //	select the folder and expand the folder to mimic project folder hierarchy
            if (eventType == EventType.MouseDown && clickCount == 2)
            {
                //	if there is no file extension which means its a folder expand it!
                if (CanExplore)
                {
                    IsSelected = false;
                    clickType  = ClickType.EXPAND;
                }
                else
                {
                    clickType = ClickType.DOUBLE_CLICK;

                    IsSelected = true;
                    if (obj != null)
                    {
                        AssetDatabase.OpenAsset(obj);
                    }
                }
            }
            else
            {
                clickType  = ClickType.CLICK;
                IsSelected = true;
            }
        }
        return(clickType);
    }
Esempio n. 4
0
    void Awake()
    {
        selectionRect = GetComponent <SelectionRect>();

        selectedUnits = new List <Unit>();

        allUnits = new List <Unit>();
        allUnits.AddRange(FindObjectsOfType <Unit>());

        alliedUnits = new List <Unit>();
        alliedUnits.AddRange(FindObjectsOfType <Unit>()
                             .Where(unit => unit.GetAlliance == Unit.Alliance.PLAYER)
                             .ToArray()
                             );

        enemyUnits = new List <Unit>();
        enemyUnits.AddRange(FindObjectsOfType <Unit>()
                            .Where(unit => unit.GetAlliance == Unit.Alliance.COMPUTER)
                            .ToArray()
                            );
    }
Esempio n. 5
0
 protected void Awake()
 {
     SM            = FindObjectOfType <L2RTSServerManager>();
     selectionRect = FindObjectOfType <SelectionRect>();
 }
 //-----------------------------------------------------------------------------
 protected override void OnCreateManager(int capacity)
 {
     base.OnCreateManager(capacity);
     m_Selection = Object.FindObjectOfType <SelectionRect>();
 }