コード例 #1
0
    public void UseSwordWeapon()
    {
        SwordProjectile newSwordProjectile = Instantiate(swordProjectile, firePoint.position, firePoint.rotation) as SwordProjectile;

        FindObjectOfType <SwordSkillImage>().SetSwordCD(swordStats[5]);
        newSwordProjectile.SetProjectileSpeedz(swordStats[0]);
        newSwordProjectile.SetProjectileSpeedy(swordStats[1]);
        newSwordProjectile.SetProjectileRotationSpeed(swordStats[2]);
        newSwordProjectile.SetProjectileDamage(swordStats[3], swordStats[9], maxRoll);
        newSwordProjectile.SetProjectileLifeTime(_projectileLifeTime);


        if (swordMultiShot)
        {
            for (int i = 0; i < swordShotgunAmount; i++)
            {
                float           random = Random.Range(-swordShotgunAmount, swordShotgunAmount);
                Vector3         spread = new Vector3(0, random, 0).normalized *swordConeSize;
                Quaternion      projectileDirection    = Quaternion.Euler(spread) * firePoint.rotation;
                SwordProjectile swordShotGunProjectile = Instantiate(swordProjectile, firePoint.position, projectileDirection) as SwordProjectile;

                swordShotGunProjectile.SetProjectileSpeedz(swordStats[0]);
                swordShotGunProjectile.SetProjectileSpeedy(swordStats[1]);
                swordShotGunProjectile.SetProjectileRotationSpeed(swordStats[2]);
                swordShotGunProjectile.SetProjectileDamage(swordStats[3], swordStats[9], maxRoll);
                swordShotGunProjectile.SetProjectileLifeTime(_projectileLifeTime);
            }
        }
    }
コード例 #2
0
        public override void Launch(GameObject actor, int startX, int startY, sbyte velX)
        {
            var projectile = SwordProjectile.Create(actor.room, this.projSubType, FVector.Create(startX, startY), FVector.Create(velX, 0));

            projectile.SetActorID(actor);
            projectile.SetEndLife(Systems.timer.Frame + this.duration);
        }
コード例 #3
0
        private void ShootSword(Constants.Direction direction)
        {
            SwordProjectile swordProjectile = new SwordProjectile(direction, entity);

            Scene.Add(swordProjectile);
        }