예제 #1
0
    public void Initialize(ProjectileRegistry registry)
    {
        settings = registry.entries[projectileTypeRegistryIndex].definition.properties;

        maxAge   = Vector3.Magnitude(endPos - startPos) / settings.velocity;
        position = startPos;
    }
예제 #2
0
    public virtual Projectile FireProjectile(float2 position, float damage, ProjectileSettings projectileType)
    {
        var projectile = new Projectile(Room, damage, projectileType, this, Position);

        projectile.DirectAt(position);
        return(projectile);
    }
예제 #3
0
    public void Initialize(ProjectileRegistry registry)
    {
        settings = registry.GetEntryById(projectileTypeRegistryId).properties;

        maxAge   = Vector3.Magnitude(endPos - startPos) / settings.velocity;
        position = startPos;
    }
    public void CreateProjectile(ProjectileSettings projectileSettings)
    {
        baseProjectilePrefab.projectileSettings = projectileSettings;
        Projectile p;

        p            = Instantiate(baseProjectilePrefab, parentChar.transform.position + (Vector3)projectileSettings.spawnOffset, parentChar.transform.rotation);
        p.parentChar = parentChar;
    }
예제 #5
0
    public void InstanceCreateProjectile(ProjectileSettings projectileSettings)
    {
        Projectile projectileInstance = Instantiate(_baseProjectile);

        projectileInstance.SetSpeed(projectileSettings.speed);

        _projectiles[projectileInstance] = projectileSettings;
    }
예제 #6
0
    public void LoadSettings(BundledResourceManager resourceSystem)
    {
        var projectileRegistry = resourceSystem.GetResourceRegistry <ProjectileRegistry>();
        var index = projectileRegistry.GetIndexByRegistryId(projectileTypeRegistryId);

        settings = projectileRegistry.entries[index].definition.properties;

        maxAge = Vector3.Magnitude(endPos - startPos) / settings.velocity;
    }
예제 #7
0
파일: Boss.cs 프로젝트: JammedGame/LD45
    public override Projectile FireProjectile(float2 position, float damage, ProjectileSettings projectileType)
    {
        var projectile1 = new Projectile(Room, damage, projectileType, this, new Vector2(Position.x - 1.5f, Position.y));

        projectile1.DirectAt(new Vector2(position.x - 1.5f, position.y));
        var projectile2 = new Projectile(Room, damage, projectileType, this, new Vector2(Position.x + 1.6f, Position.y));

        projectile2.DirectAt(new Vector2(position.x + 1.6f, position.y));
        return(projectile1);
    }
예제 #8
0
    private void SpawnBeam()
    {
        _BeamProgress = 3;
        var marusBeamSettings = new ProjectileSettings();

        marusBeamSettings.name = "MarusBeam";
        marusBeamSettings.Size = new float2(0.5f, 0.5f);
        foreach (var pos in Room.World.GameWorldData.MobSpawnPoints)
        {
            new MarusBeam(Room, marusBeamSettings, this, new Vector2(pos.x * 1.4f, pos.y * 1.4f));
        }
    }
예제 #9
0
        public ProjectileWeapon(double projectilePain, double projectileRadius, double projectileMass, double projectileSpeed, bool produceKick, bool ignoreOtherProjectiles, RadarBlipQual projectileQual, bool enforceFiringModeOuterTime, SimpleMap map, MyVector boundryLower, MyVector boundryUpper)
        {
            _projectileSettings         = new ProjectileSettings(projectileSpeed, projectileRadius, projectileMass, projectilePain, ignoreOtherProjectiles, projectileQual);
            _enforceFiringModeOuterTime = enforceFiringModeOuterTime;
            _map         = map;
            _produceKick = produceKick;

            if (boundryLower != null && boundryUpper != null)
            {
                _useBoundry   = true;
                _boundryLower = boundryLower;
                _boundryUpper = boundryUpper;
            }

            _elapsedTime = new FiringMode(0, 0, 0);
        }
예제 #10
0
    public void SetUp(PulseGun gun, ProjectileSettings settings)
    {
        this.gun      = gun;
        this.settings = settings;

        fixedRotation = Quaternion.Inverse(gun.transform.rotation) * transform.rotation;

        rigidbody.drag        = Mathf.Infinity;
        rigidbody.angularDrag = Mathf.Infinity;
        //rigidbody.useGravity = false;

        Material newMaterial = renderer.material;
        Color    newColor    = color;

        newColor.a = settings.transparency / 255f;
        newMaterial.SetColor(COLOR, newColor);
        newMaterial.SetFloat(BLUR, settings.blur);

        renderer.material.Lerp(renderer.material, newMaterial, 1f);
    }
예제 #11
0
        public Projectile(Rigidbody rigidbody, ProjectileSettings projectileSettings)
        {
            this.rigidbody = rigidbody;
            gunTransform   = projectileSettings.transform;
            distFromPlayer = projectileSettings.distFromPlayer;

            rotation      = Quaternion.Inverse(gunTransform.rotation) * rigidbody.transform.rotation;
            drag          = rigidbody.drag;
            angularDrag   = rigidbody.angularDrag;
            interpolation = rigidbody.interpolation;

            renderer      = rigidbody.gameObject.GetComponent <Renderer>();
            materialColor = renderer.material.color;

            rigidbody.drag        = Mathf.Infinity;
            rigidbody.angularDrag = Mathf.Infinity;
            //rigidbody.interpolation = RigidbodyInterpolation.Interpolate;
            materialColor.a = projectileSettings.transparency / 255f;

            renderer.material.SetFloat(DISTORTIONNAME, 1f);
            renderer.material.SetFloat(DISTORTIONTESTNAME, 1f);
            renderer.material.SetFloat(DISTORTIONBLURNAME, projectileSettings.blur);
            renderer.material.SetColor(BASECOLORNAME, materialColor);
        }
예제 #12
0
        public ProjectileWeapon(double projectilePain, double projectileRadius, double projectileMass, double projectileSpeed, bool produceKick, bool ignoreOtherProjectiles, RadarBlipQual projectileQual, bool enforceFiringModeOuterTime, SimpleMap map, MyVector boundryLower, MyVector boundryUpper)
        {
            _projectileSettings = new ProjectileSettings(projectileSpeed, projectileRadius, projectileMass, projectilePain, ignoreOtherProjectiles, projectileQual);
            _enforceFiringModeOuterTime = enforceFiringModeOuterTime;
            _map = map;
            _produceKick = produceKick;

            if (boundryLower != null && boundryUpper != null)
            {
                _useBoundry = true;
                _boundryLower = boundryLower;
                _boundryUpper = boundryUpper;
            }

            _elapsedTime = new FiringMode(0, 0, 0);
        }
예제 #13
0
 public void SetVariables(Vector3 direction, ProjectileSettings ps)
 {
     pSettings  = ps;
     _Direction = direction;
 }
예제 #14
0
 public void SetData(ProjectileSettings ps, Vector3 dir)
 {
     pSettings = ps;
     _Dir      = dir;
     transform.gameObject.SetActive(true);
 }
예제 #15
0
 public Projectile(Room room, float damage, ProjectileSettings projectileSettings, BattleObject shooter, float2 position) : base(room, projectileSettings, shooter, position)
 {
     ProjectileSettings = projectileSettings;
     Direction          = new float2(1, 0);
     Damage             = damage;
 }
예제 #16
0
	public void Setup(ProjectileSettings settings, Action<float> onDmgDone, Action<int> onKill)
	{
		this.settings = settings;
		this.onDmgDone = onDmgDone;
		this.onKill = onKill;
	}
 public ProjectileEntityPrefabProvider(ProjectileSettings projectileSettings)
 {
     _projectileSettings = projectileSettings;
 }