public virtual void Awake()
        {
            window = GetComponent<UIWindow>();
            pool = new InventoryPool<InventoryContextMenuItem>(contextMenuItemPrefab, 8);

            window.OnShow += window_OnWindowShow;
        }
        public void Awake()
        {
            window = InventoryManager.instance.craftingStandard.window;
            triggerer = GetComponent<ObjectTriggerer>();
            triggerer.window = window;
            triggerer.handleWindowDirectly = false; // We're in charge now :)

            window.OnHide += () =>
            {
                currentCraftingStation = null;
            };

            triggerer.OnTriggerUse += () =>
            {
                window.Toggle();

                if (window.isVisible)
                {
                    currentCraftingStation = this;
                    InventoryManager.instance.craftingStandard.SetCraftingCategory(category);
                }
            };
            triggerer.OnTriggerUnUse += () =>
            {
                if (currentCraftingStation == this)
                    window.Hide();
            };
        }
        public virtual void Awake()
        {
            //base.Awake();
            lootWindow = InventoryManager.instance.loot;
            window = lootWindow.window;
            triggerer = GetComponent<ObjectTriggerer>();
            triggerer.window = window;
            triggerer.handleWindowDirectly = false; // We're in charge now :)

            animator = GetComponent<Animator>();

            triggerer.OnTriggerUse += () =>
            {
                OpenTreasureChest();
            };
            triggerer.OnTriggerUnUse += () =>
            {
                if (open)
                {
                    window.Hide();

                    open = false;
                }
            };

            CreateGenerator();
        }
        public void Awake()
        {
            window = GetComponent<UIWindow>();

            //window.OnHide += () =>
            //{

            //};
        }
        public override void Awake()
        {
            base.Awake();

            windowParent = transform.parent.GetComponentInParent<UIWindow>();
            if (windowParent == null)
                Debug.LogWarning("No UIWindow found in parents", gameObject);

            // Register our page with the window parent
            windowParent.AddPage(this);
        }
        // Use this for initialization
        void Awake()
        {
            window = GetComponent<UIWindow>();

            InventoryManager.instance.inventory.OnGoldChanged += (float added) =>
            {
                if (window.isVisible)
                    Repaint();
            };

            window.OnShow += () =>
            {
                Repaint();
            };
        }
        public void Awake()
        {
            window = GetComponent<UIWindow>();

            window.OnHide += () =>
            {
                foreach (var w in otherWindows)
                {
                    if(w.isVisible && hideWhenHidden)
                        w.Hide();
                }
            };

            window.OnShow += () =>
            {
                foreach (var w in otherWindows)
                {
                    if (w.isVisible == false && showWhenShown)
                        w.Show();
                }
            };
        }
 public override void OnReset()
 {
     show = false;
     window = null;
 }
        void Awake()
        {
            currentTransform = GetComponent<RectTransform>();
            defaultPivot = currentTransform.pivot;
            window = GetComponent<UIWindow>();

            pool = new InventoryPool<InfoBoxRowUI>(infoBoxRowPrefab, 32);
            poolObjs = new InventoryPool(separatorPrefab, 8);
            poolCategoryBoxes = new InventoryPool(infoBoxCategory, 8);
        }