예제 #1
0
    /// <summary>
    /// Destroys the doll when the doll enters the Trigger Parameter
    /// </summary>
    /// <param name="collision"></param>
    private void OnTriggerEnter2D(Collider2D collision)
    {
        VooDooDoll doll = collision.GetComponent <VooDooDoll>();

        if (!doll)
        {
            return;
        }
        if (isDestryoing)
        {
            return;
        }
        GetComponent <AudioSource>().Play();
        StartCoroutine(DestroyDoll());
    }
예제 #2
0
    void OnCollisionEnter2D(Collision2D collision)
    {
        // get voodoo doll
        VooDooDoll doll = collision.transform.GetComponent <VooDooDoll>();

        if (doll)
        {
            //ScoreManager.Instance.UpdateScore(scoreAdd);
            DOTween.Rewind(gameObject);
            DOTween.PlayForward(gameObject);
            if (tears != null)
            {
                Instantiate(tears, collision.transform.position, Quaternion.identity);
            }
        }
    }
예제 #3
0
    private void OnTriggerEnter2D(Collider2D collision)
    {
        if (isStuck)
        {
            return;
        }
        // get voodoo doll
        VooDooDoll doll = collision.transform.GetComponent <VooDooDoll>();

        if (doll)
        {
            GameManager.Instance.ScoreManager.UpdateMultiplier(multiplierChanger);
            attachNeedle(doll.transform);
            isStuck = true;
        }
    }