Ejemplo n.º 1
0
    public void IteractWithSlot()
    {
        Cursor_scr Cursor = GameObject.Find("Cursor").GetComponent <Cursor_scr>();

        if (CanCraft)
        {
            GameObject Inventory = GameObject.Find("InventoryManager");
            if (!Cursor.HandContainerFull)
            {
                //Debug.Log(CraftItem);
                Cursor.CursorContainerActivation(CraftItem, CraftItemCount);


                if (InventoryComponent == null)
                {
                    InventoryComponent = Inventory.GetComponent <Inventory_scr>();
                }
                InventoryComponent.TakeItem(CraftItemComponent);
            }
            else if (Cursor.HandContainer == CraftItemComponent.id)
            {
                Cursor.CursorContainerActivation(CraftItemCount);
                InventoryComponent.TakeItem(CraftItemComponent);
            }
            InventoryComponent.CraftSlotsCheker();
        }
        else
        {
            GameObject.Find("NewDropPanel").GetComponent <LeftUpShowPanel_scr>().CheckRecepy(CraftItem);
            Debug.Log("Для сотворения чего-то  не хватает");
        }
    }
Ejemplo n.º 2
0
 private void Awake()
 {
     //InvSlot = this.gameObject.transform.GetChild(0).gameObject;
     //Count = InvSlot.gameObject.transform.GetChild(0).gameObject;
     Cursor          = GameObject.Find("Cursor");
     CursorComponent = Cursor.GetComponent <Cursor_scr>();
     //text = Count.GetComponent<Text>();
     //sprite = InvSlot.GetComponent<Image>();
 }
Ejemplo n.º 3
0
    //public CraftSlot[] ResultSlotss;


    private void Awake()
    {
        Backpack.SetActive(true);
        //IVTR.SetActive(true);
        CraftPanel.SetActive(true);

        //ResultSlots = GameObject.Find("ResultSlots");
        //ResultSlotss = GameObject.Find("ResultSlots").GetComponentsInChildren<CraftSlot>();
        //Debug.Log(ResultSlotss.Length);
        Tabs = GameObject.Find("Tabs");
        //CraftTab = GameObject.Find("CraftTab");
        cursor          = GameObject.Find("Cursor");
        CursorComponent = cursor.GetComponent <Cursor_scr>();
        player          = GameObject.Find("Player");
        //IVTR = GameObject.Find("Inventory");
        InventorySlot[] FS = FastPanel.GetComponentsInChildren <InventorySlot>();
        InventorySlot[] IS = IVTR.GetComponentsInChildren <InventorySlot>();
        InventorySlot[] CS = CraftPanel.GetComponentsInChildren <InventorySlot>();
        int             FSlen = FS.Length, ISlen = IS.Length;

        InvItemsLength = FSlen + ISlen;
        //InvItems = new GameObject[FSlen + ISlen];
        for (int i = 0; i < FSlen; i++)
        {
            InvSlots[i]            = FS[i];
            InvSlots[i].SlotNumber = i;
            InvSlots[i].Inventory  = this.gameObject;
        }
        //Debug.Log(IS.Length);
        for (int i = 12; i < IS.Length + FSlen; i++)
        {
            InvSlots[i]            = IS[i - FSlen];
            InvSlots[i].SlotNumber = i;
            InvSlots[i].Inventory  = this.gameObject;
        }
        for (int i = 0; i < CS.Length; i++)
        {
            CraftSlots[i]            = CS[i];
            CraftSlots[i].SlotNumber = i + 50;
            CraftSlots[i].Inventory  = this.gameObject;
        }


        ActivateSlot(0);
    }
Ejemplo n.º 4
0
 // Start is called before the first frame update
 void Start()
 {
     Cursor          = GameObject.Find("Cursor");
     player          = GameObject.Find("Player").GetComponent <Player_movement_scr>();
     CursorComponent = Cursor.GetComponent <Cursor_scr>();
     DropCatalog     = GameObject.Find("DropCatalog").GetComponent <DropCatalog_scr>();
     //sprite = Active.GetComponent<Image>();
     if (inSlot == null)
     {
         busy = false;
         Active.SetActive(false);
         Default.SetActive(true);
     }
     else
     {
         busy = true;
         Active.SetActive(true);
         Default.SetActive(false);
     }
 }
Ejemplo n.º 5
0
 private void Awake()
 {
     Cursor = GameObject.Find("Cursor").GetComponent <Cursor_scr>();
 }