예제 #1
0
        private void init()
        {
            _settings = rootObject.getScript <Settings>();

            _steering.maxVelocity = 3;
            _targetObjects        = rootObject.getScript <TargetableObjects>();
            _targetObjects.add(gameObject, TargetFilters.Player);

            damageParticleEmitter = gameObject.
                                    createScript <ParticleEmitter>();

            damageParticleEmitter.MinEnergy        = 0.25f;
            damageParticleEmitter.MaxEnergy        = 0.5f;
            damageParticleEmitter.Size             = new Vector2(16, 16);
            damageParticleEmitter.RandomScale      = 0.5f;
            damageParticleEmitter.EndSizeScale     = 0.5f;
            damageParticleEmitter.MinRotationSpeed = 0.1f;
            damageParticleEmitter.MaxRotationSpeed = 0.2f;
            damageParticleEmitter.StartColor       = Color.Green;
            damageParticleEmitter.EndColor         = Color.Blue;
            damageParticleEmitter.RandomVelocity   = 1f;
            damageParticleEmitter.Velocity         = 1;

            var file     = "content/textures/streak.png";
            var material = resources.
                           createMaterialFromTexture(file);

            material.SetBlendState(BlendState.Additive);

            damageParticleEmitter.material = material;

            setupEngineEmitter();
        }
예제 #2
0
        private void init()
        {
            targetObjects = rootObject.getScript <TargetableObjects>();

            particleEmitterLocation = rootObject.createChild("laseremitter");
            damageParticleEmitter   = particleEmitterLocation.
                                      createScript <ParticleEmitter>();

            damageParticleEmitter.MinEnergy        = 0.20f;
            damageParticleEmitter.MaxEnergy        = 0.40f;
            damageParticleEmitter.Size             = new Vector2(14, 14);
            damageParticleEmitter.RandomScale      = 0.2f;
            damageParticleEmitter.EndSizeScale     = 0.7f;
            damageParticleEmitter.MinRotationSpeed = 0.1f;
            damageParticleEmitter.MaxRotationSpeed = 0.2f;
            damageParticleEmitter.StartColor       = color;
            damageParticleEmitter.EndColor         = Color.Black;
            damageParticleEmitter.RandomVelocity   = 1f;
            damageParticleEmitter.Velocity         = 1;

            var file     = "content/textures/flares2/x4.png";
            var material = resources.
                           createMaterialFromTexture(file);

            material.SetBlendState(BlendState.Additive);

            damageParticleEmitter.material = material;
        }
예제 #3
0
        private void init()
        {
            if (aroundRadius != 0 && around == Vector2.Zero)
            {
                around = transform.DerivedPosition;
            }

            _targetObjects = rootObject.getScript <TargetableObjects>();
            _targetObjects.add(gameObject, friendlyFilters);

            _ship = gameObject.getScript <Ship>();

            setupEngineEmitter();
        }
예제 #4
0
        private void init()
        {
            //_transform = this.gameObject.transform();
            //_material = Root.instance.resources.findMaterial("basewhite");
            _targets      = rootObject.getScript <TargetableObjects>();
            _lineMaterial = resources.createMaterialFromTexture("content/textures/line.png");
            _lineMaterial.SetBlendState(BlendState.Additive);


            _lineCapMaterial = resources.createMaterialFromTexture("content/textures/linecap.png");
            _lineCapMaterial.SetBlendState(BlendState.Additive);


            //_material.SetBlendState(new BlendState()
            //                            {
            //                                AlphaBlendFunction = BlendFunction.Add,
            //                                ColorBlendFunction = BlendFunction.Add,
            //                                AlphaDestinationBlend = Blend.One,
            //                                AlphaSourceBlend = Blend.One,
            //                                ColorDestinationBlend = Blend.One,
            //                                ColorSourceBlend = Blend.One
            //                            });
        }
예제 #5
0
 private void init()
 {
     _settings = rootObject.getScript <Settings>();
     _player   = rootObject.getScriptWithChildren <PlayerController>();
     _targets  = rootObject.getScript <TargetableObjects>();
 }
예제 #6
0
 private void init()
 {
     _targets = rootObject.getScript <TargetableObjects>();
 }