Esempio n. 1
0
 public void CreateHitbox(GameObject hitboxOwner, int team, HitInfo hitInfo)
 {
     hitbox = InstantiateHitbox(boxDefinition);
     hitbox.Initialize(hitboxOwner, transform, team, boxDefinition.shape, hitInfo, boxDefinition, new List <IHurtable>());
     hitbox.OnHurt += DestroyBullet;
     hitbox.Activate();
 }
Esempio n. 2
0
    void OnTriggerEnter(Collider col)
    {
        Hitbox3D hitbox = col.GetComponent <Hitbox3D>();

        if (hitbox != null && hitbox.owner != this.owner)
        {
            hitbox.Deactivate();

            Vector3 hitLocation = (this.transform.position + col.bounds.ClosestPoint(this.transform.position)) / 2.0f;
            Debug.Log(hitLocation);
        }
    }
Esempio n. 3
0
    void OnTriggerEnter(Collider col)
    {
        Hitbox3D hitbox = col.GetComponent <Hitbox3D>();

        if (hitbox != null && hitbox.owner != this.owner)
        {
            Keygen entity = owner.GetComponent <Keygen>();

            entity.OnHit(hitbox.damage, hitbox.owner);

            //Visual hit effect stuff?
            //Vector3 hitLocation = (this.transform.position + col.bounds.ClosestPoint(this.transform.position)) / 2.0f;
        }
    }