コード例 #1
0
    protected override void DoWeaponActions()
    {
        //Get Projectile
        GameObject hookObject = ObjectPool.Instance.GetObject(PoolObjectType.LightningProjectile);

        if (hookObject)
        {
            //Initialize
            LightningProjectile  currentHook   = hookObject.GetComponent <LightningProjectile>();
            ProjectileProperties newProperties = new ProjectileProperties(projectileProperties);
            currentHook.Init(projectileProperties, muzzleTransform);
            currentHook.CheckForTargets();
            animator.SetTrigger("Shoot");
        }
    }
コード例 #2
0
    private void SpawnNextProjectile()
    {
        LightningGun.ProjectileProperties newProperties = new LightningGun.ProjectileProperties(projectileProperties);
        newProperties.maxDistance = projectileProperties.maxDistancePerSubChain;
        //Spawn next hook
        GameObject nextHookObject = ObjectPool.Instance.GetObject(PoolObjectType.LightningProjectile);

        if (nextHookObject)
        {
            //Initialize
            LightningProjectile nextProjectile = nextHookObject.GetComponent <LightningProjectile>();
            nextProjectile.Init(newProperties, transform, enemyCount, ignoreTargets);

            if (!nextProjectile.CheckForTargets())
            {
                nextProjectile.ResetToDefaults();
            }
        }
    }