private void Update() { countTime += Time.deltaTime; if (shotInterval <= countTime) { esm.Shot(); countTime = 0f; } }
private void Update() { if (Physics.Raycast(this.transform.position, turret.transform.position - head.transform.position, out hit, 50f)) { if (hit.collider.gameObject.CompareTag("Player")) { esm.Shot(); } } }
// Update is called once per frame void Update() { countTime += Time.deltaTime; if (countTime > checkInterval) { if (ec.GetRaycastToPlayer().transform.CompareTag("Player")) { toPlayerNotWall = true; } else { toPlayerNotWall = false; } } if (toPlayerNotWall) { cannon.transform.LookAt(target.transform); } else { ec.TurnCannonAdd(1f); } if (countTime > checkInterval) { try { if (toPlayerNotWall) { esm.Shot(); } else if (ec.GetRaycastCannon(bulletBounceNum).transform.root.CompareTag("Player")) { esm.Shot(); } }catch (Exception e) { Debug.Log(e); } countTime = 0f; } }
// Update is called once per frame void Update() { countTime += Time.deltaTime; if (countTime >= 2f) { //Debug.Log(ec.GetRaycastCannon(2).collider.gameObject); if (ec.GetRaycastHit().transform.CompareTag("Player")) { esm.Shot(); } countTime = 0f; } }