Example #1
0
        public void Shoot(Vector3 tgtPos, float hitTH, HitCallback callback)
        {
            targetPos    = tgtPos;
            hitThreshold = hitTH;
            hitCallback  = callback;

            hit = false;

            if (shootEffect != null)
            {
                if (!destroyShootEffect)
                {
                    ObjectPoolManager.Spawn(shootEffect, thisT.position, thisT.rotation);
                }
                else
                {
                    ObjectPoolManager.Spawn(shootEffect, thisT.position, thisT.rotation, shootEffectDuration);
                }
            }

            if (type == _ShootObjectType.Projectile)
            {
                StartCoroutine(ProjectileRoutine());
            }
            if (type == _ShootObjectType.Beam)
            {
                StartCoroutine(BeamRoutine());
            }
            if (type == _ShootObjectType.Missile)
            {
                StartCoroutine(MissileRoutine());
            }
            if (type == _ShootObjectType.Effect)
            {
                StartCoroutine(EffectRoutine());
            }
        }
Example #2
0
 public TargetArea(Screen owner, Container container, int depth, HitCallback hitcallback, GetNewChallengeCallback getnewchallengecallback) : base(owner, container, depth, false)
 {
     hitCallback             = hitcallback;
     getNewChallengeCallback = getnewchallengecallback;
 }