Esempio n. 1
0
        //============================================================================//
#if UNITY_EDITOR
        // INITIALIZE //
        //
        override public void Initialize(BaseStack theOwnerStack, AmpsBlueprint theOwnerBlueprint)
        {
            base.Initialize(theOwnerStack, theOwnerBlueprint);

            subMenuName = AmpsHelpers.formatEnumString(eCategories.Basic.ToString());
            type        = "Color";
            SetDefaultName();

            value = ScriptableObject.CreateInstance <ColorProperty>();
            value.Initialize("Color", Vector4.one, theOwnerBlueprint);
            AddProperty(value, true);
            implementsVisualization = false;
        }
Esempio n. 2
0
//============================================================================//
#if UNITY_EDITOR
        // INITIALIZE //
        //
        override public void Initialize(BaseStack theOwnerStack, AmpsBlueprint theOwnerBlueprint)
        {
            base.Initialize(theOwnerStack, theOwnerBlueprint);

            subMenuName = "";
            type        = "Quick setup";
            SetDefaultName();

            modifySpawnRate.value      = true;
            modifyDeathCondition.value = true;
            modifyAcceleration.value   = true;
            modifyVelocity.value       = true;
            modifyPosition.value       = true;
            modifyRotationRate.value   = true;
            modifyRotation.value       = true;
            modifyScale.value          = true;
            modifyColor.value          = true;
            modifyPivotOffset.value    = true;

            spawnRate = ScriptableObject.CreateInstance <ScalarProperty>();
            spawnRate.Initialize("Spawn rate", 5, theOwnerBlueprint);
            spawnRate.allowDataModeReference = false;
            AddProperty(spawnRate, false);

            deathCondition = ScriptableObject.CreateInstance <ScalarProperty>();
            deathCondition.Initialize("Death condition", 0, theOwnerBlueprint);
            deathCondition.allowDataModeReference = false;
            deathCondition.dataMode            = BaseProperty.eDataMode.Curve;
            deathCondition.curve.curveInput    = AmpsHelpers.eCurveInputs.ParticleTime;
            deathCondition.curve.inputRangeMin = 0;
            deathCondition.curve.inputRangeMax = 2;             // Default lifetime.
            deathCondition.curve.curve.AddKey(0, 0);
            deathCondition.curve.curve.AddKey(1, 1);
            deathCondition.curve.outputRangeMin = 0;
            deathCondition.curve.outputRangeMax = 1;
            AddProperty(deathCondition, false);

            acceleration = ScriptableObject.CreateInstance <VectorProperty>();
            acceleration.Initialize("Acceleration", new Vector4(0, -0.1f, 0, 0), theOwnerBlueprint);
            acceleration.allowDataModeReference    = false;
            acceleration.coordSystemConversionMode = BaseProperty.eCoordSystemConversionMode.AsVelocity;
            acceleration.usePerComponentRandom     = true;
            acceleration.hideW = true;
            AddProperty(acceleration, false);

            velocity = ScriptableObject.CreateInstance <VectorProperty>();
            velocity.Initialize("Velocity min", new Vector4(0, 0, 0, 0), theOwnerBlueprint);
            velocity.allowDataModeReference    = false;
            velocity.coordSystemConversionMode = BaseProperty.eCoordSystemConversionMode.AsVelocity;
            velocity.hideW = true;
            velocity.usePerComponentRandom = true;
            velocity.dataMode  = BaseProperty.eDataMode.RandomConstant;
            velocity.randomMin = new Vector4(-1, 1, -1, 0);
            velocity.randomMax = new Vector4(1, 2, 1, 0);
            AddProperty(velocity, false);

            position = ScriptableObject.CreateInstance <VectorProperty>();
            position.Initialize("Position", new Vector4(0, 0, 0, 0), theOwnerBlueprint);
            position.allowDataModeReference    = false;
            position.coordSystemConversionMode = BaseProperty.eCoordSystemConversionMode.AsPosition;
            position.coordSystem           = AmpsHelpers.eCoordSystems.Emitter;
            position.hideW                 = true;
            position.usePerComponentRandom = true;
            AddProperty(position, false);

            rotationRate = ScriptableObject.CreateInstance <VectorProperty>();
            rotationRate.Initialize("Rotation rate", new Vector4(0, 0, 0, 0), theOwnerBlueprint);
            rotationRate.allowDataModeReference    = false;
            rotationRate.coordSystemConversionMode = BaseProperty.eCoordSystemConversionMode.AsVelocity;
            rotationRate.hideW = true;
            rotationRate.usePerComponentRandom = true;
            AddProperty(rotationRate, false);

            rotation = ScriptableObject.CreateInstance <VectorProperty>();
            rotation.Initialize("Rotation", new Vector4(0, 0, 0, 0), theOwnerBlueprint);
            rotation.allowDataModeReference    = false;
            rotation.coordSystemConversionMode = BaseProperty.eCoordSystemConversionMode.AsRotation;
            rotation.coordSystem           = AmpsHelpers.eCoordSystems.Emitter;
            rotation.hideW                 = true;
            rotation.usePerComponentRandom = true;
            AddProperty(rotation, false);

            scale = ScriptableObject.CreateInstance <VectorProperty>();
            scale.Initialize("Scale", new Vector4(0.2f, 0.2f, 0.2f, 0), theOwnerBlueprint);
            scale.allowDataModeReference    = false;
            scale.coordSystemConversionMode = BaseProperty.eCoordSystemConversionMode.AsScale;
            scale.coordSystem           = AmpsHelpers.eCoordSystems.Emitter;
            scale.usePerComponentRandom = false;
            scale.hideW = true;
            AddProperty(scale, false);

            color = ScriptableObject.CreateInstance <ColorProperty>();
            color.Initialize("Color", new Vector4(1, 0.5f, 0.25f, 1), theOwnerBlueprint);
            color.allowDataModeReference = false;
            color.usePerComponentRandom  = false;
            AddProperty(color, false);

            pivotOffset = ScriptableObject.CreateInstance <VectorProperty>();
            pivotOffset.Initialize("Pivot offset", new Vector4(0, 0, 0, 0), theOwnerBlueprint);
            pivotOffset.allowDataModeReference    = false;
            pivotOffset.coordSystemConversionMode = BaseProperty.eCoordSystemConversionMode.AsPosition;
            pivotOffset.hideW = true;
            pivotOffset.usePerComponentRandom = true;
            AddProperty(pivotOffset, false);
        }