示例#1
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);
        }
示例#2
0
        public DropdownData displayData;                // The function which fetches the string array to display in the dropdown control.
        // Since delegates are not serialized it will get it's value right before first
        // UI render.
                #endif

        // GET VALUE //
        //
        public int GetValue()
        {
            int returnValue = 0;

#if UNITY_EDITOR
            CheckReferences();
#endif

            switch (dataMode)
            {
            case eDataMode.Constant:
                returnValue = constant;
                break;

            case eDataMode.Reference:
                if (reference != null)
                {
                    DropdownProperty theReference = (DropdownProperty)reference.property;
                    returnValue = theReference.GetValue();
                }
                break;
            }

            return(returnValue);
        }
示例#3
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);
        }
//============================================================================//
#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);
        }
示例#5
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);
        }
示例#6
0
        // COPY PROPERTY //
        //
        override public void CopyProperty(BaseProperty originalProperty, AmpsBlueprint theOwnerBlueprint)
        {
            base.CopyProperty(originalProperty, theOwnerBlueprint);

            DropdownProperty originalDropdownProperty = originalProperty as DropdownProperty;

            displayData = originalDropdownProperty.displayData;
            constant    = originalDropdownProperty.constant;
        }
//============================================================================//
#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);
        }
示例#8
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);
        }
//============================================================================//
#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);
        }
示例#10
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);
        }
//============================================================================//
#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;
        }
示例#12
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;
        }
示例#13
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);
        }