Exemplo n.º 1
0
        public virtual void ReleaseArrow(Vector3 direction)
        {
            if (!releaseArrow)
            {
                DestroyArrow();
                return;
            }

            if (ArrowInstance == null)
            {
                return;
            }

            ArrowInstance.transform.parent = null;

            IArrow arrow = ArrowInstance.GetComponent <IArrow>();

            arrow.HitMask            = HitLayer;                        //Transfer the same Hit Mask to the Arrow
            arrow.TriggerInteraction = TriggerInteraction;              //Link the Trigger Interatction

            arrow.Damage = Mathf.Lerp(MinDamage, MaxDamage, BowTension);
            arrow.ShootArrow(Mathf.Lerp(MinForce, MaxForce, BowTension), direction.normalized);

            OnReleaseArrow.Invoke(ArrowInstance);

            ArrowInstance = null;
        }
Exemplo n.º 2
0
        public virtual void ReleaseArrow(Vector3 direction)
        {
            if (ArrowInstance == null)
            {
                return;
            }

            ArrowInstance.transform.parent = null;

            IArrow arrow = ArrowInstance.GetComponent <IArrow>();

            arrow.HitMask = HitMask; //Transfer the same Hit Mask

            arrow.ShootArrow(Mathf.Lerp(MinForce, MaxForce, BowTension), direction);
            arrow.Damage = Mathf.Lerp(MinDamage, MaxDamage, BowTension);

            OnReleaseArrow.Invoke(ArrowInstance);

            ArrowInstance = null;
        }