// Update is called once per frame void Update() { if (ScoreManager.Timer()) { fireCooldownLeft -= Time.deltaTime; if ((fireCooldownLeft <= 0) && willShoot) { GameObject fangsGO = (GameObject)Instantiate(fangsPrefab, this.transform.position, this.transform.rotation); Fangs fangs = fangsGO.GetComponent <Fangs>(); fangs.Set(damage); fireCooldownLeft = fireCooldown; willShoot = false; Destroy(triggerGO); ResetTrigger(); } } }
private void Bite(ContactPoint2D contact) { Fangs bite = ((GameObject)Instantiate(bitePrefab, contact.point, Quaternion.identity)).GetComponent <Fangs>(); bite.ChangeSize(1 + stats.type / 2); }