Ejemplo 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        = "Property sampler";
            SetDefaultName();

            property = ScriptableObject.CreateInstance <DropdownProperty>();
            property.Initialize("Property", 0, theOwnerBlueprint);
            AddProperty(property, true);
            sampleFromParent = ScriptableObject.CreateInstance <BoolProperty>();
            sampleFromParent.Initialize("Sample parent?", false, property.ownerBlueprint);
            AddProperty(sampleFromParent, true);
            modifyX = ScriptableObject.CreateInstance <BoolProperty>();
            modifyX.Initialize("Modify X?", true, theOwnerBlueprint);
            AddProperty(modifyX, true);
            modifyY = ScriptableObject.CreateInstance <BoolProperty>();
            modifyY.Initialize("Modify Y?", true, theOwnerBlueprint);
            AddProperty(modifyY, true);
            modifyZ = ScriptableObject.CreateInstance <BoolProperty>();
            modifyZ.Initialize("Modify Z?", true, theOwnerBlueprint);
            AddProperty(modifyZ, true);
            modifyW = ScriptableObject.CreateInstance <BoolProperty>();
            modifyW.Initialize("Modify W?", true, theOwnerBlueprint);
            AddProperty(modifyW, true);
        }
Ejemplo n.º 2
0
//============================================================================//
#if UNITY_EDITOR
        // INITALIZE //
        //
        override public void Initialize(BaseStack theOwnerStack, AmpsBlueprint theOwnerBlueprint)
        {
            base.Initialize(theOwnerStack, theOwnerBlueprint);

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

            useStackValue = ScriptableObject.CreateInstance <BoolProperty>();
            useStackValue.Initialize("Use stack value?", true, theOwnerBlueprint);
            AddProperty(useStackValue, true);

            valueA = ScriptableObject.CreateInstance <ScalarProperty>();
            valueA.Initialize("Value A", 0f, theOwnerBlueprint);
            AddProperty(valueA, true);

            condition = ScriptableObject.CreateInstance <DropdownProperty>();
            condition.Initialize("Condition", 0, theOwnerBlueprint);
            condition.SetDataModes(true, false, false, false, false, false);
            AddProperty(condition, false);

            valueB = ScriptableObject.CreateInstance <ScalarProperty>();
            valueB.Initialize("Value B", 1f, theOwnerBlueprint);
            AddProperty(valueB, true);

            valueFalse = ScriptableObject.CreateInstance <ScalarProperty>();
            valueFalse.Initialize("Output for FALSE", 1f, theOwnerBlueprint);
            AddProperty(valueFalse, true);

            valueTrue = ScriptableObject.CreateInstance <ScalarProperty>();
            valueTrue.Initialize("Output for TRUE", 1f, theOwnerBlueprint);
            AddProperty(valueTrue, true);
        }
Ejemplo n.º 3
0
//============================================================================//
#if UNITY_EDITOR
        // INITIALIZE //
        //
        override public void Initialize(BaseStack theOwnerStack, AmpsBlueprint theOwnerBlueprint)
        {
            base.Initialize(theOwnerStack, theOwnerBlueprint);

            subMenuName = "";
            type        = "Quad renderer";
            SetDefaultName();

            orientation = ScriptableObject.CreateInstance <DropdownProperty>();
            orientation.Initialize("Orientation", 1, theOwnerBlueprint);
            AddProperty(orientation, false);
            alignmentVector = ScriptableObject.CreateInstance <VectorProperty>();
            alignmentVector.Initialize("Alignment vector", new Vector4(0, 1, 0, 0), theOwnerBlueprint);
            alignmentVector.hideW = true;
            AddProperty(alignmentVector, false);
            normalMode = ScriptableObject.CreateInstance <DropdownProperty>();
            normalMode.Initialize("Normal mode", 0, theOwnerBlueprint);
            AddProperty(normalMode, false);
            tangentMode = ScriptableObject.CreateInstance <DropdownProperty>();
            tangentMode.Initialize("Tangent mode", 0, theOwnerBlueprint);
            AddProperty(tangentMode, false);
            uv2Mode = ScriptableObject.CreateInstance <DropdownProperty>();
            uv2Mode.Initialize("UV2 mode", 0, theOwnerBlueprint);
            AddProperty(uv2Mode, false);
            isDoubleSided = ScriptableObject.CreateInstance <BoolProperty>();
            isDoubleSided.Initialize("Double sided?", false, theOwnerBlueprint);
            AddProperty(isDoubleSided, false);
            doubleSidedColorMode = ScriptableObject.CreateInstance <DropdownProperty>();
            doubleSidedColorMode.Initialize("Backside color mode", 0, theOwnerBlueprint);
            AddProperty(doubleSidedColorMode, false);
        }
Ejemplo n.º 4
0
//============================================================================//
#if UNITY_EDITOR
        // INITIALIZE //
        //
        override public void Initialize(BaseStack theOwnerStack, AmpsBlueprint theOwnerBlueprint)
        {
            base.Initialize(theOwnerStack, theOwnerBlueprint);

            samplerCondition = ScriptableObject.CreateInstance <DropdownProperty>();
            samplerCondition.Initialize("Sample condition", 0, theOwnerBlueprint);
            AddProperty(samplerCondition, true);
            sampleOnSpawn = ScriptableObject.CreateInstance <BoolProperty>();
            sampleOnSpawn.Initialize("Sample on spawn?", true, theOwnerBlueprint);
            AddProperty(sampleOnSpawn, true);
            interval = ScriptableObject.CreateInstance <ScalarProperty>();
            interval.Initialize("Interval", 1, theOwnerBlueprint);
            interval.SetDataModes(true, false, false, false, true, true);
            AddProperty(interval, true);
            intervalOffset = ScriptableObject.CreateInstance <ScalarProperty>();
            intervalOffset.Initialize("Initial delay", 0, theOwnerBlueprint);
            intervalOffset.SetDataModes(true, false, false, false, true, true);
            AddProperty(intervalOffset, true);
            directValue = ScriptableObject.CreateInstance <ScalarProperty>();
            directValue.Initialize("Direct value", 0, theOwnerBlueprint);
            directValue.SetDataModes(false, false, true, true, true, true);
            AddProperty(directValue, true);
            System.Random theRandom = new System.Random();
            randomSeed = theRandom.Next(1, 65536);
        }
Ejemplo n.º 5
0
//============================================================================//
#if UNITY_EDITOR
        // INITIALIZE //
        //
        override public void Initialize(BaseStack theOwnerStack, AmpsBlueprint theOwnerBlueprint)
        {
            base.Initialize(theOwnerStack, theOwnerBlueprint);

            particleMaterial = ScriptableObject.CreateInstance <MaterialProperty>();
            particleMaterial.Initialize("Material");
            AddProperty(particleMaterial, false);
        }
Ejemplo n.º 6
0
//============================================================================//
#if UNITY_EDITOR
        // INITALIZE //
        //
        override public void Initialize(BaseStack theOwnerStack, AmpsBlueprint theOwnerBlueprint)
        {
            base.Initialize(theOwnerStack, theOwnerBlueprint);

            subMenuName = AmpsHelpers.formatEnumString(eCategories.Math.ToString());
            type        = "Normalize";
            SetDefaultName();
        }
Ejemplo n.º 7
0
//============================================================================//
#if UNITY_EDITOR
        // INITIALIZE //
        //
        override public void Initialize(BaseStack theOwnerStack, AmpsBlueprint theOwnerBlueprint)
        {
            base.Initialize(theOwnerStack, theOwnerBlueprint);

            modifySpawnRate = ScriptableObject.CreateInstance <BoolProperty>();
            modifySpawnRate.Initialize("Modify Spawn rate?", false, theOwnerBlueprint);
            modifySpawnRate.allowDataModeReference = false;
            AddProperty(modifySpawnRate, false);
            modifyDeathCondition = ScriptableObject.CreateInstance <BoolProperty>();
            modifyDeathCondition.Initialize("Modify Death condition?", false, theOwnerBlueprint);
            modifyDeathCondition.allowDataModeReference = false;
            AddProperty(modifyDeathCondition, false);
            modifyDeathDuration = ScriptableObject.CreateInstance <BoolProperty>();
            modifyDeathDuration.Initialize("Modify Death duration?", false, theOwnerBlueprint);
            modifyDeathDuration.allowDataModeReference = false;
            AddProperty(modifyDeathDuration, false);
            modifyCustomScalar = ScriptableObject.CreateInstance <BoolProperty>();
            modifyCustomScalar.Initialize("Modify Custom scalar?", false, theOwnerBlueprint);
            modifyCustomScalar.allowDataModeReference = false;
            AddProperty(modifyCustomScalar, false);
            modifyCustomVector = ScriptableObject.CreateInstance <BoolProperty>();
            modifyCustomVector.Initialize("Modify Custom vector?", false, theOwnerBlueprint);
            modifyCustomVector.allowDataModeReference = false;
            AddProperty(modifyCustomVector, false);
            modifyAcceleration = ScriptableObject.CreateInstance <BoolProperty>();
            modifyAcceleration.Initialize("Modify Acceleration?", false, theOwnerBlueprint);
            modifyAcceleration.allowDataModeReference = false;
            AddProperty(modifyAcceleration, false);
            modifyVelocity = ScriptableObject.CreateInstance <BoolProperty>();
            modifyVelocity.Initialize("Modify Velocity?", false, theOwnerBlueprint);
            modifyVelocity.allowDataModeReference = false;
            AddProperty(modifyVelocity, false);
            modifyPosition = ScriptableObject.CreateInstance <BoolProperty>();
            modifyPosition.Initialize("Modify Position?", false, theOwnerBlueprint);
            modifyPosition.allowDataModeReference = false;
            AddProperty(modifyPosition, false);
            modifyRotationRate = ScriptableObject.CreateInstance <BoolProperty>();
            modifyRotationRate.Initialize("Modify Rotation rate?", false, theOwnerBlueprint);
            modifyRotationRate.allowDataModeReference = false;
            AddProperty(modifyRotationRate, false);
            modifyRotation = ScriptableObject.CreateInstance <BoolProperty>();
            modifyRotation.Initialize("Modify Rotation?", false, theOwnerBlueprint);
            modifyRotation.allowDataModeReference = false;
            AddProperty(modifyRotation, false);
            modifyScale = ScriptableObject.CreateInstance <BoolProperty>();
            modifyScale.Initialize("Modify Scale?", false, theOwnerBlueprint);
            modifyScale.allowDataModeReference = false;
            AddProperty(modifyScale, false);
            modifyColor = ScriptableObject.CreateInstance <BoolProperty>();
            modifyColor.Initialize("Modify Color?", false, theOwnerBlueprint);
            modifyColor.allowDataModeReference = false;
            AddProperty(modifyColor, false);
            modifyPivotOffset = ScriptableObject.CreateInstance <BoolProperty>();
            modifyPivotOffset.Initialize("Modify Pivot offset?", false, theOwnerBlueprint);
            modifyPivotOffset.allowDataModeReference = false;
            AddProperty(modifyPivotOffset, false);
        }
Ejemplo n.º 8
0
 // COPY STACK //
 //
 public void CopyStack(BaseStack originalStack)
 {
     modules.Clear();
     foreach (var item in originalStack.modules)
     {
         BaseModule m = ScriptableObject.CreateInstance(item.GetType()) as BaseModule;
         m.Initialize(this, ownerBlueprint);
         m.CopyProperties(item, ownerBlueprint);
         modules.Add(m);
     }
 }
Ejemplo n.º 9
0
//============================================================================//
#if UNITY_EDITOR
        // INITALIZE //
        //
        override public void Initialize(BaseStack theOwnerStack, AmpsBlueprint theOwnerBlueprint)
        {
            base.Initialize(theOwnerStack, theOwnerBlueprint);

            subMenuName = AmpsHelpers.formatEnumString(eCategories.Math.ToString());
            type        = "Converter";
            SetDefaultName();

            conversionMode = ScriptableObject.CreateInstance <DropdownProperty>();
            conversionMode.Initialize("Conversion mode", 0, theOwnerBlueprint);
            AddProperty(conversionMode, true);
        }
Ejemplo n.º 10
0
//============================================================================//
#if UNITY_EDITOR
        // INITALIZE //
        //
        override public void Initialize(BaseStack theOwnerStack, AmpsBlueprint theOwnerBlueprint)
        {
            base.Initialize(theOwnerStack, theOwnerBlueprint);

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

            value = ScriptableObject.CreateInstance <ScalarProperty>();
            value.Initialize("Value", 1f, theOwnerBlueprint);
            AddProperty(value, true);
        }
Ejemplo n.º 11
0
//============================================================================//
#if UNITY_EDITOR
        // INITIALIZE //
        //
        override public void Initialize(BaseStack theOwnerStack, AmpsBlueprint theOwnerBlueprint)
        {
            base.Initialize(theOwnerStack, theOwnerBlueprint);

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

            vector = ScriptableObject.CreateInstance <VectorProperty>();
            vector.Initialize("Vector", Vector4.zero, theOwnerBlueprint);
            vector.coordSystemConversionMode = BaseProperty.eCoordSystemConversionMode.NoConversion;
            AddProperty(vector, true);
        }
Ejemplo n.º 12
0
//============================================================================//
#if UNITY_EDITOR
        // INITIALIZE //
        //
        override public void Initialize(BaseStack theOwnerStack, AmpsBlueprint theOwnerBlueprint)
        {
            base.Initialize(theOwnerStack, theOwnerBlueprint);

            weight = ScriptableObject.CreateInstance <ScalarProperty>();
            weight.Initialize("Weight", 1, theOwnerBlueprint);
            weight.SetDataModes(true, true, true, true, false, true);
            AddProperty(weight, false);
            blendMode = ScriptableObject.CreateInstance <DropdownProperty>();
            blendMode.Initialize("Blend mode", 0, theOwnerBlueprint);
            blendMode.SetDataModes(true, false, false, false, false, false);
            AddProperty(blendMode, false);
        }
Ejemplo n.º 13
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;
        }
Ejemplo n.º 14
0
//============================================================================//
#if UNITY_EDITOR
        // INITIALIZE //
        //
        override public void Initialize(BaseStack theOwnerStack, AmpsBlueprint theOwnerBlueprint)
        {
            base.Initialize(theOwnerStack, theOwnerBlueprint);

            subMenuName = AmpsHelpers.formatEnumString(eCategories.Misc.ToString());
            type        = "Event listener";
            SetDefaultName();

            eventName = ScriptableObject.CreateInstance <StringProperty>();
            eventName.Initialize("Event name", theOwnerBlueprint);
            eventName.value = "event";
            eventName.SetDataModes(true, false, false, false, false, false);
            AddProperty(eventName, false);

            untriggeredValue = ScriptableObject.CreateInstance <VectorProperty>();
            untriggeredValue.Initialize("Untriggered value", theOwnerBlueprint);
            AddProperty(untriggeredValue, false);

            triggeredCustomValue = ScriptableObject.CreateInstance <VectorProperty>();
            triggeredCustomValue.Initialize("Triggered value", theOwnerBlueprint);
            triggeredCustomValue.constant = new Vector4(1, 0, 0, 0);
            AddProperty(triggeredCustomValue, false);

            triggerDataMode = ScriptableObject.CreateInstance <DropdownProperty>();
            triggerDataMode.Initialize("Trigger data mode", 0, theOwnerBlueprint);
            triggerDataMode.SetDataModes(true, false, false, false, false, false);
            AddProperty(triggerDataMode, false);

            infiniteTriggerCount = ScriptableObject.CreateInstance <BoolProperty>();
            infiniteTriggerCount.Initialize("Infinite trigger count?", theOwnerBlueprint);
            infiniteTriggerCount.value = true;
            infiniteTriggerCount.SetDataModes(true, false, false, false, false, false);
            AddProperty(infiniteTriggerCount, false);

            maxTriggerCount = ScriptableObject.CreateInstance <ScalarProperty>();
            maxTriggerCount.Initialize("Max trigger count per loop", 1f, theOwnerBlueprint);
            maxTriggerCount.SetDataModes(true, false, false, false, false, false);
            maxTriggerCount.isInteger = true;
            AddProperty(maxTriggerCount, false);

            triggerToggle = ScriptableObject.CreateInstance <BoolProperty>();
            triggerToggle.Initialize("Does an event toggle?", theOwnerBlueprint);
            triggerToggle.value = true;
            triggerToggle.SetDataModes(true, false, false, false, false, false);
            AddProperty(triggerToggle, false);

            triggerDuration = ScriptableObject.CreateInstance <ScalarProperty>();
            triggerDuration.Initialize("Trigger duration", 1f, theOwnerBlueprint);
            triggerDuration.SetDataModes(true, true, false, false, false, false);
            AddProperty(triggerDuration, false);
        }
Ejemplo n.º 15
0
//============================================================================//
#if UNITY_EDITOR
        // INITIALIZE //
        //
        override public void Initialize(BaseStack theOwnerStack, AmpsBlueprint theOwnerBlueprint)
        {
            base.Initialize(theOwnerStack, theOwnerBlueprint);

            subMenuName = AmpsHelpers.formatEnumString(eCategories.Shapes.ToString());
            type        = "Point sampler";
            SetDefaultName();

            point = ScriptableObject.CreateInstance <VectorProperty>();
            point.Initialize("Point", Vector4.zero, theOwnerBlueprint);
            point.coordSystemConversionMode = BaseProperty.eCoordSystemConversionMode.AsPosition;
            implementsVisualization         = true;
            AddProperty(point, true);
        }
Ejemplo n.º 16
0
//============================================================================//
#if UNITY_EDITOR
        // INITIALIZE //
        //
        override public void Initialize(BaseStack theOwnerStack, AmpsBlueprint theOwnerBlueprint)
        {
            base.Initialize(theOwnerStack, theOwnerBlueprint);

            subMenuName = AmpsHelpers.formatEnumString(eCategories.Misc.ToString());
            type        = "Child control";
            SetDefaultName();

            value = ScriptableObject.CreateInstance <ScalarProperty>();
            value.Initialize("Value", 0f, theOwnerBlueprint);
            value.SetDataModes(true, false, false, false, false, false);
            AddProperty(value, false);

            condition = ScriptableObject.CreateInstance <DropdownProperty>();
            condition.Initialize("Condition", 0, theOwnerBlueprint);
            condition.SetDataModes(true, false, false, false, false, false);
            AddProperty(condition, false);

            useCurrentStack = ScriptableObject.CreateInstance <BoolProperty>();
            useCurrentStack.Initialize("Current stack?", theOwnerBlueprint);
            useCurrentStack.value = true;
            useCurrentStack.SetDataModes(true, false, false, false, false, false);
            AddProperty(useCurrentStack, false);

            property = ScriptableObject.CreateInstance <DropdownProperty>();
            property.Initialize("Property", 0, theOwnerBlueprint);
            property.SetDataModes(true, false, false, false, false, false);
            AddProperty(property, false);

            propertyVectorComponent = ScriptableObject.CreateInstance <DropdownProperty>();
            propertyVectorComponent.Initialize("Component", 0, theOwnerBlueprint);
            propertyVectorComponent.SetDataModes(true, false, false, false, false, false);
            AddProperty(propertyVectorComponent, false);

            action = ScriptableObject.CreateInstance <DropdownProperty>();
            action.Initialize("Action", 0, theOwnerBlueprint);
            action.SetDataModes(true, false, false, false, false, false);
            AddProperty(action, false);

            maxEventCount = ScriptableObject.CreateInstance <ScalarProperty>();
            maxEventCount.Initialize("Max event count per loop", 1f, theOwnerBlueprint);
            maxEventCount.SetDataModes(true, false, false, false, false, false);
            maxEventCount.isInteger = true;
            AddProperty(maxEventCount, false);

            minEventDelay = ScriptableObject.CreateInstance <ScalarProperty>();
            minEventDelay.Initialize("Min event delay", 0.1f, theOwnerBlueprint);
            minEventDelay.SetDataModes(true, false, false, false, false, false);
            AddProperty(minEventDelay, false);
        }
Ejemplo n.º 17
0
//============================================================================//
#if UNITY_EDITOR
        // INITIALIZE //
        //
        override public void Initialize(BaseStack theOwnerStack, AmpsBlueprint theOwnerBlueprint)
        {
            base.Initialize(theOwnerStack, theOwnerBlueprint);

            subMenuName = "";
            type        = "Motion tweaker";
            SetDefaultName();

            modifyAcceleration.value = true;
            modifyVelocity.value     = true;

            modifyMomentum = ScriptableObject.CreateInstance <BoolProperty>();
            modifyMomentum.Initialize("Modify momentum?", true, theOwnerBlueprint);
            modifyMomentum.allowDataModeReference = false;
            AddProperty(modifyMomentum, false);

            modifyDisplacement = ScriptableObject.CreateInstance <BoolProperty>();
            modifyDisplacement.Initialize("Modify displacement?", true, theOwnerBlueprint);
            modifyDisplacement.allowDataModeReference = false;
            AddProperty(modifyDisplacement, false);

            accelerationMultiplier = ScriptableObject.CreateInstance <VectorProperty>();
            accelerationMultiplier.Initialize("Acceleration multiplier", Vector4.one, theOwnerBlueprint);
            accelerationMultiplier.coordSystemConversionMode = BaseProperty.eCoordSystemConversionMode.NoConversion;
            accelerationMultiplier.allowDataModeReference    = false;
            accelerationMultiplier.hideW = true;
            AddProperty(accelerationMultiplier, false);

            momentumMultiplier = ScriptableObject.CreateInstance <VectorProperty>();
            momentumMultiplier.Initialize("Momentum multiplier", Vector4.one, theOwnerBlueprint);
            momentumMultiplier.coordSystemConversionMode = BaseProperty.eCoordSystemConversionMode.NoConversion;
            momentumMultiplier.allowDataModeReference    = false;
            momentumMultiplier.hideW = true;
            AddProperty(momentumMultiplier, false);

            velocityMultiplier = ScriptableObject.CreateInstance <VectorProperty>();
            velocityMultiplier.Initialize("Velocity multiplier", Vector4.one, theOwnerBlueprint);
            velocityMultiplier.coordSystemConversionMode = BaseProperty.eCoordSystemConversionMode.NoConversion;
            velocityMultiplier.allowDataModeReference    = false;
            velocityMultiplier.hideW = true;
            AddProperty(velocityMultiplier, false);

            displacementMultiplier = ScriptableObject.CreateInstance <VectorProperty>();
            displacementMultiplier.Initialize("Displacement multiplier", Vector4.one, theOwnerBlueprint);
            displacementMultiplier.coordSystemConversionMode = BaseProperty.eCoordSystemConversionMode.NoConversion;
            displacementMultiplier.allowDataModeReference    = false;
            displacementMultiplier.hideW = true;
            AddProperty(displacementMultiplier, false);
        }
Ejemplo n.º 18
0
//============================================================================//
#if UNITY_EDITOR
        // INITIALIZE //
        //
        override public void Initialize(BaseStack theOwnerStack, AmpsBlueprint theOwnerBlueprint)
        {
            base.Initialize(theOwnerStack, theOwnerBlueprint);

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

            value = ScriptableObject.CreateInstance <VectorProperty>();
            value.Initialize("Value", Vector4.zero, theOwnerBlueprint);
            value.SetConversionMode(theOwnerStack.stackFunction);
            value.SetDefaultCoordSystem(theOwnerStack.stackFunction);
            AddProperty(value, true);
            implementsVisualization = true;
        }
Ejemplo n.º 19
0
//============================================================================//
#if UNITY_EDITOR
        // INITALIZE //
        //
        override public void Initialize(BaseStack theOwnerStack, AmpsBlueprint theOwnerBlueprint)
        {
            base.Initialize(theOwnerStack, theOwnerBlueprint);

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

            useStackValue = ScriptableObject.CreateInstance <BoolProperty>();
            useStackValue.Initialize("Use stack value?", true, theOwnerBlueprint);
            AddProperty(useStackValue, true);

            changePerSecond = ScriptableObject.CreateInstance <ScalarProperty>();
            changePerSecond.Initialize("Change per second", 1f, theOwnerBlueprint);
            AddProperty(changePerSecond, true);
        }
Ejemplo n.º 20
0
//============================================================================//
#if UNITY_EDITOR
        // INITIALIZE //
        //
        virtual public void Initialize(BaseStack theOwnerStack, AmpsBlueprint theOwnerBlueprint)
        {
            type             = "";
            subMenuName      = "";
            ownerBlueprint   = theOwnerBlueprint;
            ownerStack       = theOwnerStack;
            shouldSelectThis = false;
            exampleInput     = Vector4.zero;

            properties       = new List <BaseProperty>();
            sharedProperties = new List <BaseProperty>();

            moduleName = ScriptableObject.CreateInstance <StringProperty>();
            moduleName.Initialize("Description", "");
            AddProperty(moduleName, false);
            selectedProperty = moduleName;
        }
Ejemplo n.º 21
0
//============================================================================//
#if UNITY_EDITOR
        // INITIALIZE //
        //
        override public void Initialize(BaseStack theOwnerStack, AmpsBlueprint theOwnerBlueprint)
        {
            base.Initialize(theOwnerStack, theOwnerBlueprint);

            subMenuName = AmpsHelpers.formatEnumString(eCategories.OtherObjects.ToString());
            type        = "Transform sampler";
            SetDefaultName();

            sampledObject = ScriptableObject.CreateInstance <GameObjectProperty>();
            sampledObject.Initialize("Object", null, theOwnerBlueprint);
            sampledObject.SetDataModes(false, false, false, false, false, true);
            AddProperty(sampledObject, false);
            sampledTransformElement = ScriptableObject.CreateInstance <DropdownProperty>();
            sampledTransformElement.Initialize("Transform", 0, theOwnerBlueprint);
            AddProperty(sampledTransformElement, true);
            implementsVisualization = false;
        }
Ejemplo n.º 22
0
//============================================================================//
#if UNITY_EDITOR
        // INITIALIZE //
        //
        override public void Initialize(BaseStack theOwnerStack, AmpsBlueprint theOwnerBlueprint)
        {
            base.Initialize(theOwnerStack, theOwnerBlueprint);

            type = "Basic setup";

            emitterDuration = ScriptableObject.CreateInstance <ScalarProperty>();
            emitterDuration.Initialize("Emitter duration", 5, theOwnerBlueprint);
            emitterDuration.SetDataModes(true, false, false, false, false, true);
            AddProperty(emitterDuration, false);
            isLooping = ScriptableObject.CreateInstance <BoolProperty>();
            isLooping.SetDataModes(true, false, false, false, false, false);
            isLooping.Initialize("Looping?", true, theOwnerBlueprint);
            AddProperty(isLooping, false);
            maxParticles = ScriptableObject.CreateInstance <ScalarProperty>();
            maxParticles.Initialize("Particle limit", 10, theOwnerBlueprint);
            maxParticles.SetDataModes(true, true, false, false, false, false);
            maxParticles.isInteger = true;
            AddProperty(maxParticles, false);
            updateRate = ScriptableObject.CreateInstance <ScalarProperty>();
            updateRate.Initialize("Updates per second", 30, theOwnerBlueprint);
            updateRate.SetDataModes(true, false, false, false, false, false);
            AddProperty(updateRate, false);
            timeScale = ScriptableObject.CreateInstance <ScalarProperty>();
            timeScale.Initialize("Time scale", 1, theOwnerBlueprint);
            timeScale.SetDataModes(true, false, false, false, false, false);
            AddProperty(timeScale, false);
            accelerationNoiseSmoothing = ScriptableObject.CreateInstance <ScalarProperty>();
            accelerationNoiseSmoothing.Initialize("Accel. noise smoothing", 0.5f, theOwnerBlueprint);
            accelerationNoiseSmoothing.SetDataModes(true, false, false, false, false, false);
            AddProperty(accelerationNoiseSmoothing, false);
            playOnAwake = ScriptableObject.CreateInstance <BoolProperty>();
            playOnAwake.SetDataModes(true, false, false, false, false, false);
            playOnAwake.Initialize("Plays on start?", true, theOwnerBlueprint);
            AddProperty(playOnAwake, false);
            pauseWhenUnseenDuration = ScriptableObject.CreateInstance <ScalarProperty>();
            pauseWhenUnseenDuration.Initialize("Pause when unseen duration", 1, theOwnerBlueprint);
            pauseWhenUnseenDuration.SetDataModes(true, false, false, false, false, false);
            AddProperty(pauseWhenUnseenDuration, false);
            //canParentControlPlayback = ScriptableObject.CreateInstance<BoolProperty>();
            //canParentControlPlayback.SetDataModes(true, false, false, false, false, false);
            //canParentControlPlayback.Initialize("Can parent control playback?", true, theOwnerBlueprint);
            //AddProperty(canParentControlPlayback, false);
        }
Ejemplo n.º 23
0
//============================================================================//
#if UNITY_EDITOR
        // INITIALIZE //
        //
        override public void Initialize(BaseStack theOwnerStack, AmpsBlueprint theOwnerBlueprint)
        {
            base.Initialize(theOwnerStack, theOwnerBlueprint);

            subMenuName = "";
            type        = "Mesh renderer";
            SetDefaultName();

            inputMeshCount = ScriptableObject.CreateInstance <ScalarProperty>();
            inputMeshCount.Initialize("Mesh count", 1, theOwnerBlueprint);
            inputMeshCount.SetDataModes(true, false, false, false, false, false);
            inputMeshCount.isInteger = true;
            AddProperty(inputMeshCount, false);
            inputMeshes    = new MeshProperty[1];
            inputMeshes[0] = ScriptableObject.CreateInstance <MeshProperty>();
            inputMeshes[0].Initialize("Mesh 0");
            // We don't add mesh[0] to the property array because we will handle
            // the dynamic array of meshes in our own CopyProperties().

            //SoftReset();	// To initialize the private variables.
        }
Ejemplo n.º 24
0
        // COPY PROPERTIES //
        //
        virtual public void CopyProperties(BaseModule originalModule, AmpsBlueprint theOwnerBlueprint)
        {
            name = type;

            isEnabled  = originalModule.isEnabled;
            ownerStack = originalModule.ownerStack;
            if (theOwnerBlueprint != null)
            {
                ownerBlueprint = theOwnerBlueprint;
            }
            else
            {
                ownerBlueprint = originalModule.ownerBlueprint;
            }

            properties.RemoveAll(item => item == null);

            for (int i = 0; i < properties.Count; i++)
            {
                properties[i].CopyProperty(originalModule.properties[i], theOwnerBlueprint);
            }
        }
Ejemplo n.º 25
0
        //============================================================================//
#if UNITY_EDITOR
        // INITIALIZE //
        //
        override public void Initialize(BaseStack theOwnerStack, AmpsBlueprint theOwnerBlueprint)
        {
            base.Initialize(theOwnerStack, theOwnerBlueprint);

            subMenuName = AmpsHelpers.formatEnumString(eCategories.Shapes.ToString());
            type        = "Mesh sampler";
            SetDefaultName();

            sampledMesh = ScriptableObject.CreateInstance <MeshProperty>();
            sampledMesh.Initialize("Mesh");
            AddProperty(sampledMesh, true);
            sampledMeshElement = ScriptableObject.CreateInstance <DropdownProperty>();
            sampledMeshElement.Initialize("Element", 0, theOwnerBlueprint);
            AddProperty(sampledMeshElement, true);
            samplingOrder = ScriptableObject.CreateInstance <DropdownProperty>();
            samplingOrder.Initialize("Order", 0, theOwnerBlueprint);
            AddProperty(samplingOrder, true);
            isEmitterRelative = ScriptableObject.CreateInstance <BoolProperty>();
            isEmitterRelative.Initialize("Emitter relative?", theOwnerBlueprint);
            AddProperty(isEmitterRelative, true);
            implementsVisualization = false;
        }
Ejemplo n.º 26
0
//============================================================================//
        #region GUI

        // SHOW STACK //
        //
        // The stack renders its own UI.
        // The passed parameter helps to determine whether itself is selected in the
        // owner emitter. Also if either of the two (label looking) buttons are pressed
        // then selectedStack is set to self.
        public void ShowStack(ref BaseStack selectedStack)
        {
            // Shows the box for the stack.
            GUIStyle actualStyle;
            GUIStyle actualButtonStyle;

            if (selectedStack == this)
            {
                actualStyle       = GUI.skin.GetStyle("stackBoxSelected");
                actualButtonStyle = GUI.skin.GetStyle("stackButton");
            }
            else
            {
                actualStyle       = GUI.skin.GetStyle("stackBoxNormal");
                actualButtonStyle = GUI.skin.GetStyle("stackButton");
            }

            GUILayout.BeginHorizontal(actualStyle);
            if (GUILayout.Button(name, actualButtonStyle, GUILayout.Height(20)))
            {
                // Directly focus the ever present description property to avoid the weird
                // "focused inputfield carries over value to new inputfield" issue.
                GUI.FocusControl(AmpsHelpers.stringControlName);
                selectedStack = this;
            }
            if (modules.Count > 0)
            {
                if (GUILayout.Button("(" + modules.Count.ToString() + ")", "stackModuleNumber", GUILayout.Height(20)))
                {
                    selectedStack = this;
                    // Directly focus the ever present description property to avoid the weird
                    // "focused inputfield carries over value to new inputfield" issue.
                    GUI.FocusControl(AmpsHelpers.stringControlName);
                }
            }

            GUILayout.EndHorizontal();
        }
Ejemplo n.º 27
0
//============================================================================//
#if UNITY_EDITOR
        // INITIALIZE //
        //
        override public void Initialize(BaseStack theOwnerStack, AmpsBlueprint theOwnerBlueprint)
        {
            base.Initialize(theOwnerStack, theOwnerBlueprint);

            subMenuName = AmpsHelpers.formatEnumString(eCategories.Misc.ToString());
            type        = "Info";
            SetDefaultName();

            label = ScriptableObject.CreateInstance <StringProperty>();
            label.Initialize("=", theOwnerBlueprint);
            label.value = "n.a.";
            AddProperty(label, false);

            showCurrentStack = ScriptableObject.CreateInstance <BoolProperty>();
            showCurrentStack.Initialize("Show current stack value?", theOwnerBlueprint);
            showCurrentStack.value = true;
            showCurrentStack.SetDataModes(true, false, false, false, false, false);
            AddProperty(showCurrentStack, false);

            property = ScriptableObject.CreateInstance <DropdownProperty>();
            property.Initialize("Property", 0, theOwnerBlueprint);
            AddProperty(property, true);
        }
Ejemplo n.º 28
0
        // HANDLE BLUEPRINT CHANGE //
        //
        public void HandleBlueprintChange()
        {
            if (blueprint != null)
            {
                blueprint.ownerEmitter = this;
                selectedStack          = blueprint.emitterStack;
                emitterModule          = blueprint.emitterStack.modules[0] as BaseEmitterModule;
                                #if UNITY_EDITOR
                UpdateSharedPropertyList();
                                #endif
            }
            else
            {
                selectedStack = null;
                emitterModule = null;
            }

                        #if UNITY_EDITOR
            previousBlueprint = blueprint;
                        #endif

            SoftReset();
        }
Ejemplo n.º 29
0
//============================================================================//
#if UNITY_EDITOR
        // INITIALIZE //
        //
        override public void Initialize(BaseStack theOwnerStack, AmpsBlueprint theOwnerBlueprint)
        {
            base.Initialize(theOwnerStack, theOwnerBlueprint);

            subMenuName = AmpsHelpers.formatEnumString(eCategories.OtherObjects.ToString());
            type        = "Volume sampler";
            SetDefaultName();

            sampledObject = ScriptableObject.CreateInstance <GameObjectProperty>();
            sampledObject.Initialize("Object", null, theOwnerBlueprint);
            sampledObject.SetDataModes(false, false, false, false, false, true);
            AddProperty(sampledObject, false);
            insideValue = ScriptableObject.CreateInstance <VectorProperty>();
            insideValue.Initialize("Value if inside", Vector4.one, theOwnerBlueprint);
            insideValue.SetConversionMode(theOwnerStack.stackFunction);
            insideValue.SetDefaultCoordSystem(theOwnerStack.stackFunction);
            AddProperty(insideValue, true);
            outsideValue = ScriptableObject.CreateInstance <VectorProperty>();
            outsideValue.Initialize("Value if outside", Vector4.one, theOwnerBlueprint);
            outsideValue.SetConversionMode(theOwnerStack.stackFunction);
            outsideValue.SetDefaultCoordSystem(theOwnerStack.stackFunction);
            AddProperty(outsideValue, true);
            implementsVisualization = false;
        }
Ejemplo n.º 30
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);
        }