GetImpactPoint() публичный Метод

Gets the impact point location that will spawn when this object is hit.
public GetImpactPoint ( ) : Vector3
Результат Vector3
Пример #1
0
    public static void DestroyOrb(ObjectInteraction orbToDestroy)
    {
        //Spawn an impact
        Impact.SpawnHitImpact(Impact.ImpactDamage(), orbToDestroy.GetImpactPoint(), 46, 50);
        Quest.instance.isOrbDestroyed            = true;
        UWCharacter.Instance.PlayerMagic.MaxMana = UWCharacter.Instance.PlayerMagic.TrueMaxMana;
        UWCharacter.Instance.PlayerMagic.CurMana = UWCharacter.Instance.PlayerMagic.MaxMana;
        //000-001-133 The orb is destroyed
        UWHUD.instance.MessageScroll.Add(StringController.instance.GetString(1, 133));

        orbToDestroy.consumeObject();
    }
Пример #2
0
    /// <summary>
    /// Detects if a talisman has been thrown into the abyss lava trigger.
    /// </summary>
    /// <param name="other">Other.</param>
    void OnTriggerEnter(Collider other)
    {
        if (other.gameObject.GetComponent <ObjectInteraction>() != null)
        {
            if (Quest.instance.isGaramonBuried == false)
            {
                return;
            }
            ObjectInteraction objInt = other.gameObject.GetComponent <ObjectInteraction>();
            switch (objInt.item_id)
            {
            case Quest.TalismanHonour:
            case Quest.TalismanBook:
            case Quest.TalismanCup:
            case Quest.TalismanRing:
            case Quest.TalismanShield:
            case Quest.TalismanSword:
            case Quest.TalismanTaper:
            case Quest.TalismanTaperLit:
            case Quest.TalismanWine:
                Quest.instance.TalismansRemaining--;
                break;

            default:
                return;
            }

            Impact.SpawnHitImpact(Impact.ImpactMagic(), objInt.GetImpactPoint(), 40, 44);


            objInt.consumeObject();

            //Suck the avatar into the ethereal void.
            if (Quest.instance.TalismansRemaining <= 0)
            {
                StartCoroutine(SuckItAvatar());
            }
        }
    }
    protected virtual void Detonate(Collision collision)
    {
        HasHit = true;
        //Code to execute when a projectile hits a spot (for launching AOE effects)
        spellprop.onImpact(this.transform);
        ObjectInteraction objInt = collision.gameObject.GetComponent <ObjectInteraction> ();

        if (objInt != null)        //Has the projectile hit anything
        {
            //Special code for magic spell direct hits.
            spellprop.onHit(objInt);
            //Applies damage
            objInt.Attack(spellprop.BaseDamage, caster);
            //Create a impact animation to illustrate the collision
            if (objInt.GetHitFrameStart() >= 0)
            {
                Impact.SpawnHitImpact(Impact.ImpactMagic(), objInt.GetImpactPoint(), objInt.GetHitFrameStart(), objInt.GetHitFrameEnd());
            }
        }
        else
        {
            //Test if this is a player.
            if (collision.gameObject.GetComponent <UWCharacter> () != null)
            {
                int ratio = UWCharacter.Instance.getSpellResistance(spellprop);
                collision.gameObject.GetComponent <UWCharacter> ().ApplyDamage(spellprop.BaseDamage / ratio);
                spellprop.onHitPlayer();
            }
            else
            {
                //Do a miss impact
                Impact.SpawnHitImpact(Impact.ImpactDamage(), this.transform.position, spellprop.impactFrameStart, spellprop.impactFrameEnd);
            }
        }
        DestroyProjectile();
    }
    /// <summary>
    /// The Projectile hits something.
    /// </summary>
    /// <param name="collision">Collision.</param>
    /// Does not impact the caster
    /// Calls onImpact
    /// Calls onHit
    /// Applys Attack
    /// Generates an impact effect
    void OnCollisionEnter(Collision collision)
    {    //
        if (caster == null)
        {
            caster = this.gameObject;
        }
        if (collision.gameObject.name == caster.name)
        {        //Prevents the caster from hitting themselves
            return;
        }
        if (HasHit == true)
        {        //Only impact once.
            return;
        }
        else
        {
            HasHit = true;

            //Code to execute when a projectile hits a spot (for launching AOE effects)
            spellprop.onImpact(this.transform);

            ObjectInteraction objInt = collision.gameObject.GetComponent <ObjectInteraction>();

            if (objInt != null)          //Has the projectile hit anything
            {
                //Special code for magic spell direct hits.
                spellprop.onHit(objInt);

                //Applies damage
                objInt.Attack(spellprop.BaseDamage, caster);

                //Create a impact animation to illustrate the collision
                if (objInt.GetHitFrameStart() >= 0)
                {
                    Impact.SpawnHitImpact(Impact.ImpactMagic(), objInt.GetImpactPoint(), objInt.GetHitFrameStart(), objInt.GetHitFrameEnd());
                }
            }
            else
            {
                //Test if this is a player.
                if (collision.gameObject.GetComponent <UWCharacter>() != null)
                {
                    collision.gameObject.GetComponent <UWCharacter>().ApplyDamage(spellprop.BaseDamage);
                    spellprop.onHitPlayer();
                }
                else
                {
                    //Do a miss impact
                    Impact.SpawnHitImpact(Impact.ImpactDamage(), this.transform.position, spellprop.impactFrameStart, spellprop.impactFrameEnd);
                }
            }

            ObjectInteraction objIntThis = this.GetComponent <ObjectInteraction>();
            if (objIntThis != null)
            {
                objIntThis.objectloaderinfo.InUseFlag = 0;              //Free up object slot
            }

            DestroyObject(this.gameObject);
        }
    }