예제 #1
0
    public void takeHit(float power, HitBox hit)
    {
        KnockBackAble nba = m_ObjectOwner.GetComponent<KnockBackAble>();

        if (nba)
        {
            Vector3 dir = m_ObjectOwner.transform.position - hit.transform.position;
            nba.Knockback(power, dir);
        }

        KnockUpAble nua = m_ObjectOwner.GetComponent<KnockUpAble>();

        if (nua)
        {
            Vector3 dir = m_ObjectOwner.transform.position - hit.transform.position;
            nua.Knockback(power);
        }

        Damageable da = m_ObjectOwner.GetComponent<Damageable>();

        if (da)
        {
            da.injury(power);
        }

        NotifiedHit not = m_ObjectOwner.GetComponent<NotifiedHit>();

        if (not)
        {
            not.notifyHit();
        }
    }
예제 #2
0
    // Use this for initialization
    void Start()
    {
        m_rigidbody = GetComponent <Rigidbody>();
        m_animator  = GetComponent <Animator>();

        m_hitbox      = GetComponentInChildren <HitBox>();
        m_notifiedHit = GetComponent <NotifiedHit>();
    }
예제 #3
0
    // Use this for initialization
    void Start()
    {
        newRanDirection();

        newRanTargetLocation();

        m_notifiedHit = GetComponent <NotifiedHit>();
    }
예제 #4
0
 private void Start()
 {
     m_notifiedHit = GetComponent <NotifiedHit>();
 }