Ejemplo n.º 1
0
    void OnCollisionEnter(Collision col)
    {
        ContactPoint cp = col.contacts[0];
        GameObject GG = col.gameObject;

        if (GG.tag == "Player")
        {
            PN = GG.GetComponent<PlayerNetwork>();
            PN.RpcApplyStatusEffectClient(StatusEffectHandler.EffectType.HIT);
            PN.GetStatusEffectHandler().AddStatusEffect(StatusEffectHandler.EffectType.HIT);
            GameObject.Instantiate(explosionPrefab, transform.position, new Quaternion());
            Destroy(gameObject);
        }
    }
Ejemplo n.º 2
0
    void OnCollisionEnter(Collision col)
    {
        ContactPoint cp = col.contacts[0];
        GameObject   GG = col.gameObject;

        if (GG.tag == "Player")
        {
            PN = GG.GetComponent <PlayerNetwork>();
            PN.RpcApplyStatusEffectClient(StatusEffectHandler.EffectType.HIT);
            PN.GetStatusEffectHandler().AddStatusEffect(StatusEffectHandler.EffectType.HIT);
            GameObject.Instantiate(explosionPrefab, transform.position, new Quaternion());
            Destroy(gameObject);
        }
    }
Ejemplo n.º 3
0
    void OnCollisionEnter(Collision col)
    {
        ContactPoint cp = col.contacts[0];
        GameObject GG = col.gameObject;
        rb.velocity = Vector3.Reflect(oldVel, cp.normal);
        rb.velocity += cp.normal * 2.0f;
        Vector3 tempVel = rb.velocity;
        tempVel.y = 0.0f;
        rb.velocity = tempVel;

        if(GG.tag == "Player")
        {
            PN = GG.GetComponent<PlayerNetwork>();
            PN.RpcApplyStatusEffectClient(StatusEffectHandler.EffectType.HIT);
            PN.GetStatusEffectHandler().AddStatusEffect(StatusEffectHandler.EffectType.HIT);

            Destroy(gameObject);
        }
    }
Ejemplo n.º 4
0
    void OnCollisionEnter(Collision col)
    {
        ContactPoint cp = col.contacts[0];
        GameObject   GG = col.gameObject;

        rb.velocity  = Vector3.Reflect(oldVel, cp.normal);
        rb.velocity += cp.normal * 2.0f;
        Vector3 tempVel = rb.velocity;

        tempVel.y   = 0.0f;
        rb.velocity = tempVel;

        if (GG.tag == "Player")
        {
            PN = GG.GetComponent <PlayerNetwork>();
            PN.RpcApplyStatusEffectClient(StatusEffectHandler.EffectType.HIT);
            PN.GetStatusEffectHandler().AddStatusEffect(StatusEffectHandler.EffectType.HIT);

            Destroy(gameObject);
        }
    }