/// <summary>
        /// Deselect the given object
        /// </summary>
        private void Deselect(SelectedInfo deselectionInfo)
        {
            // Remove old selection, if any
            if (deselectionInfo != null)
            {
                //Debug.Log(String.Format("{0} deselecting {1}", LOG_TAG, deselectionInfo.SelectedObject.name));

                _selectedObjects.Remove(deselectionInfo);

                UpdateOutline(deselectionInfo.SelectedObject, showOutline: false);

                if (AddSelectedToContollerActives)
                {
                    deselectionInfo.Source.RemoveActives(deselectionInfo.SelectedObject);
                }

                if (DeselectEvent != null)
                {
                    DeselectEvent(deselectionInfo.SelectedObject);
                }
            }
        }
Example #2
0
        internal static void ModelIndexChanged()
        {
            MainControl control = MainForm.Instance._mainControl;

            MDL0Node model = null;

            if (SelectedInfo != null)
            {
                model = SelectedInfo.SelectedModel;

                if (model != null)
                {
                    control.ModelPanel.RemoveTarget(model);
                }

                SelectedInfo.ModelIndexChanged();
                model = SelectedInfo.SelectedModel;
            }

            control._resetCamera = false;
            control.TargetModel  = model;
            control.UpdateModel();
        }
Example #3
0
    public IEnumerator AfterSmallMove()
    {
        while (!ExchangeComplete || bm == null || bm.GetTurnStep() == 3 || bm.GetTurnStep() == 4 || bm.GetTurnStep() == 9 /* || !(bm.GetTurnStep() == 6 || bm.GetTurnStep() == 7 || bm.GetTurnStep() == 16)*/)
        {
            yield return(null);
        }
        //LogDisplay.AddText("ExchangeComplete is " + ExchangeComplete + ".");
        while (opponentPlayerCardCode == -1)
        {
            yield return(null);
        }
        //LogDisplay.AddText("opponentPlayerCardCode is " + opponentPlayerCardCode + ".");
        if (selectedCardInfo != null)
        {
            if (opponentPlayerCardCode == 8)    // TODO 하드코딩 주의
            {
                MoveTime(GameObject.FindGameObjectWithTag(selectedCardInfo.GetLR()).transform.position, selectedCardInfo.GetOriginalPosition(), selectedCardInfo.GetLR());
            }
            else
            {
                MoveCardDown(GameObject.FindGameObjectWithTag(selectedCardInfo.GetLR()).transform.position, selectedCardInfo.GetOriginalPosition(), selectedCardInfo.GetLR());
            }

            StartCoroutine(process.Dequeue()); // 아래로 내려가게 함

            selectedCardInfo       = null;
            selectedCard           = null;
            moved                  = false;
            selected               = false;
            ExchangeComplete       = false;
            opponentPlayerCardCode = -1;
        }
        else if (selectedCardInfo == null)
        {
            //LogDisplay.AddText("selectedCardInfo is null.");
        }
    }
        private void GetCurrentElementInfo()
        {
            #region 当前图层上已经选中的元素
            UpdateGroupframeList();
            _currentSelectedElement.Clear();
            _selectedElementCollection.Clear();
            int foreachIndex = -1;
            bool isfu = false;
            if (_groupframeList.Keys.Contains(-1))
            {
                isfu = true;
            }
            else
            {
                _groupframeList.Add(-1, null);
            }
            foreach (int groupName in _groupframeList.Keys)
            {
                ObservableCollection<IRectElement> selectedElement = new ObservableCollection<IRectElement>();
                ObservableCollection<IRectElement> noSelectedElement = new ObservableCollection<IRectElement>();
                Rect selectedElementRect = new Rect();
                Rect noSelectedElementRect = new Rect();
                for (int i = 0; i < _myScreenLayer.ElementCollection.Count; i++)
                {
                    if (_myScreenLayer.ElementCollection[i] is LineElement)
                    {
                        _myScreenLayer.ElementCollection[i].ZIndex = 7;
                        continue;
                    }
                    if (_myScreenLayer.ElementCollection[i].EleType == ElementType.frameSelected)
                    {
                        _myScreenLayer.ElementCollection[i].ZIndex = 8;
                        continue;
                    }
                    if (_myScreenLayer.ElementCollection[i].EleType != ElementType.receive
                        || _myScreenLayer.ElementCollection[i].GroupName != groupName)
                    {
                        continue;
                    }
                    IRectElement rectelement = (IRectElement)_myScreenLayer.ElementCollection[i];
                    Rect rect = new Rect(rectelement.X, rectelement.Y, rectelement.Width, rectelement.Height);
                    if (rectelement.ElementSelectedState != SelectedState.None)
                    {
                        if (rectelement.GroupName == -1)
                        {
                            _myScreenLayer.ElementCollection[i].ZIndex = 5;
                        }
                        else
                        {
                            _myScreenLayer.ElementCollection[i].ZIndex = 4;
                        }
                        selectedElement.Add((IRectElement)_myScreenLayer.ElementCollection[i]);
                        _selectedElementCollection.Add((IRectElement)_myScreenLayer.ElementCollection[i]);
                        if (selectedElement.Count == 1)
                        {
                            selectedElementRect = rect;
                        }
                        else
                        {
                            selectedElementRect = Rect.Union(selectedElementRect, rect);
                        }
                    }
                    else
                    {
                        _myScreenLayer.ElementCollection[i].ZIndex = 3;
                        noSelectedElement.Add((IRectElement)_myScreenLayer.ElementCollection[i]);
                        if (noSelectedElement.Count == 1)
                        {
                            noSelectedElementRect = rect;
                        }
                        else
                        {
                            noSelectedElementRect = Rect.Union(noSelectedElementRect, rect);
                        }
                    }
                }
                if (selectedElement.Count != 0)
                {
                    if (groupName>=0 && _groupframeList.Count!=0 && _groupframeList[groupName] != null)
                    {
                        _groupframeList[groupName].ZIndex = 5;
                        _groupframeList[groupName].ElementSelectedState = SelectedState.Selected;
                    }
                    for (int n = 0; n < noSelectedElement.Count; n++)
                    {
                        noSelectedElement[n].ZIndex = 3;
                    }

                }
                else
                {
                    if (groupName>=0 && _groupframeList.Count!=0 && _groupframeList[groupName] != null)
                    {
                        _groupframeList[groupName].ZIndex = 1;
                        _groupframeList[groupName].ElementSelectedState = SelectedState.None;
                    }
                    for (int n = 0; n < noSelectedElement.Count; n++)
                    {
                        noSelectedElement[n].ZIndex = 1;
                    }

                }
                SelectedInfo selectedInfo = new SelectedInfo(selectedElement, noSelectedElement, selectedElementRect, noSelectedElementRect);
                if (!(groupName == -1 && selectedElement.Count == 0 && noSelectedElement.Count == 0))
                {
                    _currentSelectedElement.Add(groupName, selectedInfo);
                }
                if (selectedElement.Count != 0)
                {
                    if (foreachIndex == -1)
                    {
                        foreachIndex += 1;
                        _selectedElementRect = selectedElementRect;
                    }
                    else
                    {
                        _selectedElementRect = Rect.Union(_selectedElementRect, selectedElementRect);
                    }
                }

            }
            if (CurrentRectElement != null)
            {
                CurrentRectElement.ZIndex = 6;
                if (CurrentRectElement.GroupName != -1)
                {
                    if(_groupframeList!=null && _groupframeList.Count!=0 && _groupframeList.Keys.Contains(CurrentRectElement.GroupName))
                    _groupframeList[CurrentRectElement.GroupName].ZIndex = 6;
                }
            }
            if (!isfu)
            {
                _groupframeList.Remove(-1);
            }

            #endregion
            UpdateExpandAndSelectedInfo();
        }
 private void Start()
 {
     panel = FindObjectOfType <SelectedInfo>();
     gen   = FindObjectOfType <Generator>();
 }
Example #6
0
 public void SetSelectedCard(SelectedInfo card)
 {
     selectedCardInfo = card;
 }