/// <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; } } }
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(); }
void HandleViewUpdate(PGIView view) { if (view.Model != null) { var slot = GetComponent <PGISlot>(); var cell = slot.CorrespondingCell; if (cell != null) { cell.SkipAutoEquip = slot.SkipAutoEquip; } } }
/// <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; } }
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); }
void OnEnable() { RectTrans = transform as RectTransform; UpdateView(); View = _View; }
void Start() { View = GetComponent <PGIView>(); }