예제 #1
0
    public void HurtPeople(GameObject collider)
    {
        if (collider.layer != 8)
        {
            StatesManager states = collider.GetComponent <StatesManager>();
            if (states != null)
            {
                if (!states.isDodge)
                {
                    states.Hurt(damage);
                    Instantiate(blood, transform.position, Quaternion.LookRotation(-transform.forward));
                }
            }
            else
            {
                Instantiate(sparks, transform.position, Quaternion.LookRotation(-transform.forward));
            }

            ShieldScript shieldScript = collider.GetComponent <ShieldScript>();
            if (shieldScript != null)
            {
                gameObject.SetActive(false);
            }
        }
    }