void Update() { if (Input.GetKeyDown(key_attack)) { tank.Attack(); } if (Input.GetKeyDown(key_use)) { //UnFinished function tank.UseItem(); } }
// Update is called once per frame void OnTriggerStay2D(Collider2D col) { if (col.isTrigger != true && col.CompareTag("Player") && timer < 3) { timer += Time.deltaTime; } if (col.CompareTag("Player") && timer >= 3) { enemyAI.Attack(true); } if (!col.CompareTag("Player")) { enemyAI.fire = false; timer = 0; } }