public void InitDefault()
        {
            ArraySize.SetValue(Vector3.One);
            ArrayModulo.SetValue(1);

            var colorAnim = new MyAnimatedPropertyVector4();

            colorAnim.AddKey(0, Vector4.One);
            colorAnim.AddKey(0.33f, Vector4.One);
            colorAnim.AddKey(0.66f, Vector4.One);
            colorAnim.AddKey(1, Vector4.One);
            Color.AddKey(0, colorAnim);

            var colorIntensityAnim = new MyAnimatedPropertyFloat();

            colorIntensityAnim.AddKey(0, 1.0f);
            colorIntensityAnim.AddKey(0.33f, 1.0f);
            colorIntensityAnim.AddKey(0.66f, 1.0f);
            colorIntensityAnim.AddKey(1, 1.0f);
            ColorIntensity.AddKey(0, colorIntensityAnim);

            Offset.SetValue(new Vector3(0, 0, 0));
            Direction.SetValue(new Vector3(0, 0, -1));

            var radiusAnim = new MyAnimatedPropertyFloat();

            radiusAnim.AddKey(0, 0.1f);
            radiusAnim.AddKey(0.33f, 0.1f);
            radiusAnim.AddKey(0.66f, 0.1f);
            radiusAnim.AddKey(1, 0.1f);
            Radius.AddKey(0, radiusAnim);

            Life.SetValue(1);

            StreakMultiplier.SetValue(4);
            AnimationFrameTime.SetValue(1);

            Enabled.SetValue(true);

            EmitterSize.AddKey(0, new Vector3(0.0f, 0.0f, 0.0f));
            EmitterSizeMin.AddKey(0, 0.0f);
            DirectionCone.AddKey(0, 0.0f);
            DirectionConeVar.AddKey(0, 0.0f);

            Velocity.AddKey(0, 1.0f);
            VelocityVar.AddKey(0, 0.0f);

            ParticlesPerSecond.AddKey(0, 1000.0f);
            Material.SetValue(MyTransparentMaterials.GetMaterial("WhiteBlock"));

            SoftParticleDistanceScale.SetValue(1);
            Bounciness.SetValue(0.5f);
            ColorVar.SetValue(0);
            HueVar.SetValue(0);

            OITWeightFactor.SetValue(1f);

            TargetCoverage.SetValue(1f);
        }
Example #2
0
        public void InitDefault()
        {
            ArraySize.SetValue(Vector3.One);
            ArrayModulo.SetValue(1);

            var colorAnim = new MyAnimatedPropertyVector4();

            colorAnim.AddKey(0, Vector4.One);
            colorAnim.AddKey(0.33f, Vector4.One);
            colorAnim.AddKey(0.66f, Vector4.One);
            colorAnim.AddKey(1, Vector4.One);
            Color.AddKey(0, colorAnim);

            Velocity.SetValue(new Vector3(0, 0, -1));

            var radiusAnim = new MyAnimatedPropertyFloat();

            radiusAnim.AddKey(0, 0.1f);
            radiusAnim.AddKey(0.33f, 0.1f);
            radiusAnim.AddKey(0.66f, 0.1f);
            radiusAnim.AddKey(1, 0.1f);
            Radius.AddKey(0, radiusAnim);

            Life.SetValue(1);

            StreakMultiplier.SetValue(4);
            AnimationFrameTime.SetValue(1);

            Enabled.SetValue(true);

            ParticlesPerSecond.SetValue(30000);
            Material.SetValue(MyTransparentMaterials.GetMaterial("WhiteBlock"));

            SoftParticleDistanceScale.SetValue(1);
            Bounciness.SetValue(0.5f);

            OITWeightFactor.SetValue(1f);
        }
        internal void ApplyPatch(ColliderPatch patch)
        {
            _collider.enabled                  = _collider.enabled.GetPatchApplied(IsEnabled.ApplyPatch(patch.Enabled));
            _collider.isTrigger                = _collider.isTrigger.GetPatchApplied(IsTrigger.ApplyPatch(patch.IsTrigger));
            _collider.material.bounciness      = _collider.material.bounciness.GetPatchApplied(Bounciness.ApplyPatch(patch.Bounciness));
            _collider.material.staticFriction  = _collider.material.staticFriction.GetPatchApplied(StaticFriction.ApplyPatch(patch.StaticFriction));
            _collider.material.dynamicFriction = _collider.material.dynamicFriction.GetPatchApplied(DynamicFriction.ApplyPatch(patch.DynamicFriction));

            MREAPI.AppsAPI.LayerApplicator.ApplyLayerToCollider(patch.Layer, _collider);

            if (patch.EventSubscriptions != null)
            {
                // Clear existing subscription flags and set them to the new values.  We do not patch arrays,
                // and thus we will always send the entire value down for all of the subscriptions.
                _colliderEventSubscriptions = ColliderEventType.None;
                foreach (var sub in patch.EventSubscriptions)
                {
                    _colliderEventSubscriptions |= sub;
                }
            }
        }