public void pressedAttack() { //Debug.Log("Trying to attack"); MessageSystem.instance.triggerEventCall("MeleeAttack"); if (!heroInventory.isOpeningInventory) { if (heroAttack == null) { heroAttack = GameObject.FindObjectOfType <HeroMeleeButton>(); } heroAttack.doAttack(); //Debug.Log("Attacked"); //else } //Debug.Log("Successful to attack"); }
// Use this for initialization void Start() { heroAttack = GameObject.FindObjectOfType <HeroMeleeButton>(); heroInventory = FindObjectOfType <AndroidInventoryScript>(); }