Exemplo n.º 1
0
 // Update is called once per frame
 void Update()
 {
     try
     {
         inventory  = GameObject.FindGameObjectWithTag("Player").GetComponent <Inventory>();
         inventoryH = GameObject.FindGameObjectWithTag("UI").GetComponent <HighlightInventory>();
     }
     catch
     {
     }
     try
     {
         if (Input.GetKey(KeyCode.Space) && canBePickedUp)
         {
             pickup();
         }
         if (inventory.highlightedObject != this)
         {
             Color tmp = this.GetComponent <SpriteRenderer>().color;
             tmp.a = 1f;
             this.GetComponent <SpriteRenderer>().color = tmp;
         }
     }
     catch
     {
     }
 }
 void Start()
 {
     inventoryH    = GameObject.FindGameObjectsWithTag("UI")[0];
     inventoryHigh = GameObject.FindGameObjectWithTag("UI").GetComponent <HighlightInventory>();
     imageInv      = inventoryH.GetComponent <Image>();
     //imageInvTip = inventoryTip.GetComponent<Image>();
     soundinventoryOpen = GameObject.Find("InventoryHide").GetComponent <AudioSource>();
 }
Exemplo n.º 3
0
 // Start is called before the first frame update
 void Start()
 {
     try
     {
         soundpickup = GameObject.Find("PickupSound").GetComponent <AudioSource>();
         inventory   = GameObject.FindGameObjectWithTag("Player").GetComponent <Inventory>();
         inventoryH  = GameObject.FindGameObjectWithTag("UI").GetComponent <HighlightInventory>();
     }
     catch
     {
     }
 }
Exemplo n.º 4
0
 // Start is called before the first frame update
 void Start()
 {
     try
     {
         inventory    = GameObject.FindGameObjectWithTag("Player").GetComponent <Inventory>();
         player       = GameObject.FindGameObjectWithTag("Player").transform;
         playerObject = GameObject.FindGameObjectWithTag("Player").GetComponent <MovementPlatformer>();
         inventoryH   = GameObject.FindGameObjectWithTag("UI").GetComponent <HighlightInventory>();
     }
     catch
     {
     }
 }
Exemplo n.º 5
0
 // Start is called before the first frame update
 void Start()
 {
     playerObject = GameObject.FindGameObjectWithTag("Player").GetComponent <MovementPlatformer>();
     inventoryH   = GameObject.FindGameObjectWithTag("UI").GetComponent <HighlightInventory>();
 }
Exemplo n.º 6
0
 void Start()
 {
     inventoryH = GameObject.FindGameObjectWithTag("UI").GetComponent <HighlightInventory>();
 }