Example #1
0
        public void setData(UInventory inventory, IItemSelectedListener listener)
        {
            this.inventory=inventory;
            this.listener = listener;

            this.position = new Rect(this.position.x,
                                     this.position.y,
                                     inventory.getWidth(),
                                     inventory.getHeight());
        }
Example #2
0
        void Start()
        {
            playerCamera = SingletonNames.getMainCamera();
            playerInventory = SingletonNames.getInventory().GetComponent<UInventory>();

            this.audioSource = gameObject.AddComponent<AudioSource>();

            doorController = new DoorController();

            guiController = SingletonNames.getGUI().GetComponent<GUIController>();
        }
Example #3
0
        public void TryInit()
        {
            if(slot==null)
                slot = new SlotData();

            if(slot.position.CellsXCount<1)
                slot.position.CellsXCount=1;

            if(slot.position.CellsYCount<1)
                slot.position.CellsYCount=1;

            if(background==null)
                background = DImageList.getInstance().getImage("external_inventory_background");

            if(correctCellImage==null)
                correctCellImage = DImageList.getInstance().getImage("inventory_correct_cell");

            if(playerInventory==null)
                playerInventory = SingletonNames.getInventory().GetComponent<UInventory>();

            if(drawService==null)
                drawService = new ItemDrawService(playerInventory.iconStyle, playerInventory.iconShadow);

            titleStyle = playerInventory.titleStyle;

            titleText   = CLang.getInstance().get(titleTextId);
            captionText = CLang.getInstance().get(captionTextId);
        }
Example #4
0
        void Start()
        {
            slot = new SlotData();

                foreach(string item in initListItems)
                    addItem(DObjectList.getInstance().getItem(item));

                background = DImageList.getInstance().getImage("external_inventory_background");
                correctCellImage = DImageList.getInstance().getImage("inventory_correct_cell");

                playerInventory = SingletonNames.getInventory().GetComponent<UInventory>();
                drawService = new ItemDrawService(playerInventory.iconStyle, playerInventory.iconShadow);
                titleStyle = playerInventory.titleStyle;

                titleText = CLang.getInstance().get(titleTextId);
                captionText = CLang.getInstance().get(captionTextId);

                initListItems.Clear();

                slot.position.CellsXCount = cellXCount;
                slot.position.CellsYCount = cellYCount;
        }
Example #5
0
 void OnEnable()
 {
     inventory = target as UInventory;
 }