예제 #1
0
 /// <summary>
 /// Helper used to restore this slot's color from a
 /// drag-related highlighted state to whatever it should
 /// be otherwise. The color restored to usually depends
 /// on if it has an item stored in it currently.
 /// </summary>
 /// <param name="defaultViewColor">The default color for slots when nothing is stored and the slot has no special state.</param>
 public void AssignHighlighting(PGIView view)
 {
     if (view == null)
     {
         return;
     }
     if (Blocked)
     {
         HighlightColor = view.BlockedColor;
     }
     else if (Item != null)
     {
         HighlightColor = Item.Highlight;
     }
     else
     {
         HighlightColor = view.NormalColor;
     }
     if (view.BlockDisabledCells)
     {
         var pos = view.GetSlotLocation(this);
         if (view.Model.IsCellDisabled(pos.X, pos.Y))
         {
             HighlightColor = view.BlockedColor;
         }
     }
 }
예제 #2
0
 void HandleViewUpdated(PGIView view)
 {
     if (View != null && CorrespondingCell != null)
     {
         CorrespondingCell.Blocked       = this.Blocked;
         CorrespondingCell.SkipAutoEquip = this.SkipAutoEquip;
     }
 }
        protected override void OnEnable()
        {
            TargetView = target as PGIView;

            //we need to do this because CustomEditor is kinda dumb
            //and won't expose the type we passed to it. Plus relfection
            //can't seem to get at the data either.
            EditorTargetType = typeof(PGIView);
            base.OnEnable();
        }
예제 #4
0
 void HandleViewUpdate(PGIView view)
 {
     if (view.Model != null)
     {
         var slot = GetComponent <PGISlot>();
         var cell = slot.CorrespondingCell;
         if (cell != null)
         {
             cell.SkipAutoEquip = slot.SkipAutoEquip;
         }
     }
 }
예제 #5
0
 /// <summary>
 /// Helper used to restore this slot's color from a
 /// drag-related highlighted state to whatever it should
 /// be otherwise. The color restored to usually depends
 /// on if it has an item stored in it currently.
 /// </summary>
 /// <param name="defaultViewColor">The default color for slots when nothing is stored and the slot has no special state.</param>
 public void AssignHighlighting(PGIView view)
 {
     if (view == null)
     {
         return;
     }
     if (Blocked)
     {
         HighlightColor = view.BlockedColor;
     }
     else if (Item != null)
     {
         HighlightColor = Item.Highlight;
     }
     else
     {
         HighlightColor = view.NormalColor;
     }
 }
예제 #6
0
        void OnEnable()
        {
            OldDragState      = ShoppersView.DisableDragging;
            OldDropState      = ShoppersView.DisableDropping;
            OldWorldDropState = ShoppersView.DisableWorldDropping;

            ShoppersView.DisableDragging      = true;
            ShoppersView.DisableDropping      = true;
            ShoppersView.DisableWorldDropping = true;
            var menu = ShoppersViewRoot.GetComponentInChildren <MenuEventHandlers>();

            menu.ChangeMenuState(true);

            ShopViewRoot.SetActive(true);
            ShopView = ShopViewRoot.GetComponentInChildren <PGIView>();


            ShoppersView.OnClickSlot.AddListener(ProcessSale);
            ShopView.OnClickSlot.AddListener(ProcessSale);
        }
예제 #7
0
 void OnEnable()
 {
     RectTrans = transform as RectTransform;
     UpdateView();
     View = _View;
 }
예제 #8
0
 void Start()
 {
     View = GetComponent <PGIView>();
 }