예제 #1
0
    // 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();
            }
        }
    }
예제 #2
0
    private void Bite(ContactPoint2D contact)
    {
        Fangs bite = ((GameObject)Instantiate(bitePrefab, contact.point, Quaternion.identity)).GetComponent <Fangs>();

        bite.ChangeSize(1 + stats.type / 2);
    }