コード例 #1
0
    public void attack()
    {
        // Get a projectile from our pool
        PlayerSpellProjectile projectile = this.pool_projectile_get();

        // Launch projectile
        projectile.attack(this.soSpellAttack.damage(), this.attackPoint.position, this.attackPoint.forward);

        // Start cool down
        this.attackReady = false;
        this.StartCoroutine("attack_cool_down");
    }
コード例 #2
0
    private void pool_projectile_create()
    {
        // Create projectile instance and add to pool
        PlayerSpellProjectile projectile = Instantiate(this.soSpellAttack.projectilePrefab, this.spellHolder) as PlayerSpellProjectile;

        projectile.transform.localPosition = Vector3.zero;
        this.projectilesInPool.Add(projectile);

        // Initialize projectile
        projectile.initialize_components(this.spellHolder);
        projectile.initialize_properties(this.soSpellAttack.projectileSpeed, this.soSpellAttack.projectileLifeTime, this.soSpellAttack.collisionTags);
        projectile.hide();
    }