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()); }
void Start() { playerCamera = SingletonNames.getMainCamera(); playerInventory = SingletonNames.getInventory().GetComponent<UInventory>(); this.audioSource = gameObject.AddComponent<AudioSource>(); doorController = new DoorController(); guiController = SingletonNames.getGUI().GetComponent<GUIController>(); }
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); }
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; }
void OnEnable() { inventory = target as UInventory; }