Пример #1
0
    // Update is called once per frame
    void Update()
    {
        Debug.Log("torcia:::::::::::" + slotUsed);
        if (tof != null && (SelectionSlotManager.currentSlotSelected == slotUsed))
        {
            if (Input.GetButtonDown("Fire3"))
            {
                tof.turnOn();
                Debug.Log("accesa");
            }
            else if (Input.GetButtonDown("Fire2"))
            {
                tof.turnOff();
            }
        }

        if (SelectionSlotManager.currentSlotSelected == slotUsed)
        {
            ToggleVisibility(this.gameObject.transform.GetChild(0).transform, true);
        }
        else
        {
            ToggleVisibility(this.gameObject.transform.GetChild(0).transform, false);
        }

        if (tof.active)
        {
            time += Time.deltaTime;
            Debug.Log(time);
            if (time >= LIFE_TIME)
            {
                Debug.Log("removing in::::" + slotUsed);
                SelectionSlotManager.removeAtSlot(slotUsed);
                Destroy(this.gameObject);
                PlayerObjectController.takedObjects[getPositionInObjectList()] = null;
            }
            else if (time > nextChange)
            {
                ((RectTransform)SelectionSlotManager.getAtSlot(slotUsed).transform.GetChild(0).GetComponent <RectTransform>()).sizeDelta =
                    new Vector2(70, 66 - CHANGE_FOR_ACTION * nextChange / SEC_NEXT_CHANGE);
                nextChange += SEC_NEXT_CHANGE;
            }
        }
    }
Пример #2
0
 void Update()
 {
     Debug.Log("martello:::::::::::" + slotUsed);
     if (SelectionSlotManager.currentSlotSelected == slotUsed)
     {
         ToggleVisibility(this.gameObject.transform, true);
     }
     else
     {
         ToggleVisibility(this.gameObject.transform, false);
     }
     if (slotUsed == SelectionSlotManager.currentSlotSelected && Input.GetButtonDown("Fire2") && SearchTag.search("dst", slectionManager.getSelection()))
     {
         Destroy(slectionManager.getSelection());
         Destroy(this.gameObject);
         PlayerObjectController.takedObjects[getPositionInObjectList()] = null;
         SelectionSlotManager.removeAtSlot();
         victoryCheck.blockDestroied++;
     }
 }