Beispiel #1
0
//============================================================================//
        #region GUI

        // SHOW PROPERTIES //
        //
        override public void ShowProperties(ref bool shouldRepaint)
        {
            base.ShowProperties(ref shouldRepaint);

            BaseProperty previousSelection = selectedProperty;

            PropertyGroup("");
            useStackValue.ShowProperty(ref selectedProperty, false);
            if (useStackValue.GetValue() == false)
            {
                valueA.ShowProperty(ref selectedProperty, false);
            }

            if (condition.displayData == null)
            {
                condition.displayData = () => conditionsDisplayData;                                            // We have to do this here because delegates are not serialized.
            }
            condition.ShowProperty(ref selectedProperty, false);

            valueB.ShowProperty(ref selectedProperty, false);
            valueFalse.ShowProperty(ref selectedProperty, false);
            valueTrue.ShowProperty(ref selectedProperty, false);

            if (selectedProperty != previousSelection)
            {
                shouldRepaint = true;
            }
        }
        // SHOW PROPERTIES //
        //
        override public void ShowProperties(ref bool shouldRepaint)
        {
            BaseProperty previousSelection = selectedProperty;

            //moduleName.ShowProperty(ref selectedProperty, false);
            playOnAwake.ShowProperty(ref selectedProperty, false);
            pauseWhenUnseenDuration.ShowProperty(ref selectedProperty, false);

            //if (canParentControlPlayback == null)	// HACK
            //{
            //    canParentControlPlayback = ScriptableObject.CreateInstance<BoolProperty>();
            //    canParentControlPlayback.SetDataModes(true, false, false, false, false, false);
            //    canParentControlPlayback.Initialize("Can parent control playback?", true, ownerBlueprint);
            //    AddProperty(canParentControlPlayback, false);
            //}
            //canParentControlPlayback.ShowProperty(ref selectedProperty, false);

            emitterDuration.ShowProperty(ref selectedProperty, false);
            isLooping.ShowProperty(ref selectedProperty, false);
            maxParticles.ShowProperty(ref selectedProperty, false);
            timeScale.ShowProperty(ref selectedProperty, false);
            accelerationNoiseSmoothing.ShowProperty(ref selectedProperty, false);
            // TODO: Add update rate.

            if (selectedProperty != previousSelection)
            {
                shouldRepaint = true;
            }
        }
        //============================================================================//
        #region GUI

        // SHOW PROPERTIES //
        //
        override public void ShowProperties(ref bool shouldRepaint)
        {
            base.ShowProperties(ref shouldRepaint);

            BaseProperty previousSelection = selectedProperty;

            PropertyGroup("Mesh");
            sampledMesh.ShowProperty(ref selectedProperty, false);
            if (sampledMeshElement.displayData == null)
            {
                sampledMeshElement.displayData = () => meshElementsDisplayData;                                                     // We have to do this here because delegates are not serialized.
            }
            sampledMeshElement.ShowProperty(ref selectedProperty, false);
            if (samplingOrder.displayData == null)
            {
                samplingOrder.displayData = () => samplingOrderDisplayData;                                                // We have to do this here because delegates are not serialized.
            }
            samplingOrder.ShowProperty(ref selectedProperty, false);

            if (isEmitterRelative == null)              // HACK
            {
                isEmitterRelative = ScriptableObject.CreateInstance <BoolProperty>();
                isEmitterRelative.Initialize("Emitter relative?", ownerBlueprint);
                AddProperty(isEmitterRelative, true);
            }
            isEmitterRelative.ShowProperty(ref selectedProperty, false);

            if (selectedProperty != previousSelection)
            {
                shouldRepaint = true;
            }
        }
//============================================================================//
        #region GUI

        // SHOW PROPERTIES //
        //
        override public void ShowProperties(ref bool shouldRepaint)
        {
            base.ShowProperties(ref shouldRepaint);

            eventName.ShowProperty(ref selectedProperty, false);
            untriggeredValue.ShowProperty(ref selectedProperty, false);

            if (triggerDataMode.displayData == null)
            {
                triggerDataMode.displayData = () => triggerDataModesDisplayData;                                                  // We have to do this here because delegates are not serialized.
            }
            triggerDataMode.ShowProperty(ref selectedProperty, false);

            if ((eTriggerDataModes)triggerDataMode.GetValue() == eTriggerDataModes.CustomValue)
            {
                triggeredCustomValue.ShowProperty(ref selectedProperty, false);
            }

            infiniteTriggerCount.ShowProperty(ref selectedProperty, false);
            if (infiniteTriggerCount.GetValue() == false)
            {
                maxTriggerCount.ShowProperty(ref selectedProperty, false);
            }

            triggerToggle.ShowProperty(ref selectedProperty, false);
            if (triggerToggle.GetValue() == false)
            {
                triggerDuration.ShowProperty(ref selectedProperty, false);
            }
        }
Beispiel #5
0
//============================================================================//
        #region GUI

        // SHOW PROPERTIES //
        //
        override public void ShowProperties(ref bool shouldRepaint)
        {
            moduleName.ShowProperty(ref selectedProperty, false);

            useCurrentStack.ShowProperty(ref selectedProperty, false);
            if (useCurrentStack.GetValue() == false)
            {
                if (property.displayData == null)
                {
                    property.displayData = () => AmpsHelpers.curveInputDisplayData;                                               // We have to do this here because delegates are not serialized.
                }
                property.ShowProperty(ref selectedProperty, false);
            }

            if ((useCurrentStack.GetValue() == false &&
                 AmpsHelpers.isFloatInput((AmpsHelpers.eCurveInputs)property.GetValue()) == false)
                ||
                (useCurrentStack.GetValue() &&
                 AmpsHelpers.isFloatStack(ownerStack.stackFunction) == false))
            {
                if (propertyVectorComponent.displayData == null)
                {
                    propertyVectorComponent.displayData = () => AmpsHelpers.vectorComponentsDisplayData;                                                              // We have to do this here because delegates are not serialized.
                }
                propertyVectorComponent.ShowProperty(ref selectedProperty, false);
            }

            if (condition.displayData == null)
            {
                condition.displayData = () => conditionsDisplayData;                                            // We have to do this here because delegates are not serialized.
            }
            condition.ShowProperty(ref selectedProperty, false);
            value.ShowProperty(ref selectedProperty, false);

            if (action.displayData == null)
            {
                action.displayData = () => actionsDisplayData;                                         // We have to do this here because delegates are not serialized.
            }
            action.ShowProperty(ref selectedProperty, false);

            PropertyGroup("Constraints");
            if (maxEventCount == null)                  // HACK
            {
                maxEventCount = ScriptableObject.CreateInstance <ScalarProperty>();
                maxEventCount.Initialize("Max event count per loop", 1f, ownerBlueprint);
                maxEventCount.SetDataModes(true, false, false, false, false, false);
                maxEventCount.isInteger = true;
                AddProperty(maxEventCount, false);
            }
            maxEventCount.ShowProperty(ref selectedProperty, false);
            minEventDelay.ShowProperty(ref selectedProperty, false);

            shouldRepaint = true;
        }
//============================================================================//
        #region GUI

        // SHOW PROPERTIES //
        //
        override public void ShowProperties(ref bool shouldRepaint)
        {
            base.ShowProperties(ref shouldRepaint);

            BaseProperty previousSelection = selectedProperty;

            PropertyGroup("Sampler");

            int previousSamplerCondition = samplerCondition.GetValue();

            if (samplerCondition.displayData == null)
            {
                samplerCondition.displayData = () => samplerConditionsDisplayData;                                                   // We have to do this here because delegates are not serialized.
            }
            samplerCondition.ShowProperty(ref selectedProperty, false);
            // If the sampler condition has changed then we select the related dropdown property
            // to void having a property selected which might not be displayed bellow.
            if (samplerCondition.GetValue() != previousSamplerCondition)
            {
                selectedProperty = samplerCondition;
            }
            if (samplerCondition.GetValue() != (int)eSamplerConditions.OnCreation)
            {
                sampleOnSpawn.ShowProperty(ref selectedProperty, false);
            }

            // BUG: It is possible that the selected property is not shown which is visually confusing.
            switch (samplerCondition.GetValue())
            {
            case (int)eSamplerConditions.OnCreation:
                intervalOffset.ShowProperty(ref selectedProperty, false);
                break;

            case (int)eSamplerConditions.ByTime:
                interval.ShowProperty(ref selectedProperty, false);
                intervalOffset.ShowProperty(ref selectedProperty, false);
                break;

            case (int)eSamplerConditions.ByDirectValue:
                directValue.ShowProperty(ref selectedProperty, false);
                break;

            default:
                break;
            }

            if (selectedProperty != previousSelection)
            {
                shouldRepaint = true;
            }
        }
Beispiel #7
0
        //// COPY PROPERTIES //
        ////
        //override public void CopyProperties(BaseModule originalModule, AmpsBlueprint theOwnerBlueprint)
        //{
        //    base.CopyProperties(originalModule, theOwnerBlueprint);
        //}

//============================================================================//
        #region GUI

        // SHOW PROPERTIES //
        //
        override public void ShowProperties(ref bool shouldRepaint)
        {
            showCurrentStack.ShowProperty(ref selectedProperty, false);
            if (showCurrentStack.GetValue() == false)
            {
                if (property.displayData == null)
                {
                    property.displayData = () => AmpsHelpers.curveInputDisplayData;                                               // We have to do this here because delegates are not serialized.
                }
                property.ShowProperty(ref selectedProperty, false);
            }
            label.ShowProperty(ref selectedProperty, true);

            shouldRepaint = true;
        }
Beispiel #8
0
//============================================================================//
        #region GUI

        // SHOW PROPERTIES //
        //
        override public void ShowProperties(ref bool shouldRepaint)
        {
            base.ShowProperties(ref shouldRepaint);

            BaseProperty previousSelection = selectedProperty;

            PropertyGroup("");
            useStackValue.ShowProperty(ref selectedProperty, false);
            if (useStackValue.GetValue() == false)
            {
                changePerSecond.ShowProperty(ref selectedProperty, false);
            }

            if (selectedProperty != previousSelection)
            {
                shouldRepaint = true;
            }
        }
//============================================================================//
        #region GUI

        // SHOW PROPERTIES //
        //
        override public void ShowProperties(ref bool shouldRepaint)
        {
            base.ShowProperties(ref shouldRepaint);

            BaseProperty previousSelection = selectedProperty;

            PropertyGroup("");
            if (property.displayData == null)
            {
                property.displayData = () => AmpsHelpers.curveInputDisplayData;                                           // We have to do this here because delegates are not serialized.
            }
            property.ShowProperty(ref selectedProperty, false);
            sampleFromParent.ShowProperty(ref selectedProperty, false);
            modifyX.ShowProperty(ref selectedProperty, false);
            modifyY.ShowProperty(ref selectedProperty, false);
            modifyZ.ShowProperty(ref selectedProperty, false);
            modifyW.ShowProperty(ref selectedProperty, false);
            if (selectedProperty != previousSelection)
            {
                shouldRepaint = true;
            }
        }
        //// COPY PROPERTIES //
        ////
        //override public void CopyProperties(BaseModule originalModule, AmpsBlueprint theOwnerBlueprint)
        //{
        //    base.CopyProperties(originalModule, ownerBlueprint);

        //    MotionTweakerMFModule om = originalModule as MotionTweakerMFModule;
        //    if (om != null)
        //    {
        //        modifyMomentum.CopyProperty(om.modifyMomentum, theOwnerBlueprint);
        //        modifyDisplacement.CopyProperty(om.modifyDisplacement, theOwnerBlueprint);
        //        accelerationMultiplier.CopyProperty(om.accelerationMultiplier, theOwnerBlueprint);
        //        momentumMultiplier.CopyProperty(om.momentumMultiplier, theOwnerBlueprint);
        //        velocityMultiplier.CopyProperty(om.velocityMultiplier, theOwnerBlueprint);
        //        displacementMultiplier.CopyProperty(om.displacementMultiplier, theOwnerBlueprint);
        //    }
        //}

//============================================================================//
        #region GUI

        // SHOW PROPERTIES //
        //
        override public void ShowProperties(ref bool shouldRepaint)
        {
            base.ShowProperties(ref shouldRepaint);

            BaseProperty previousSelection = selectedProperty;

            PropertyGroup("Acceleration");
            modifyAcceleration.ShowProperty(ref selectedProperty, false);
            accelerationMultiplier.ShowProperty(ref selectedProperty, false);
            modifyMomentum.ShowProperty(ref selectedProperty, false);
            momentumMultiplier.ShowProperty(ref selectedProperty, false);

            PropertyGroup("Velocity");
            modifyVelocity.ShowProperty(ref selectedProperty, false);
            velocityMultiplier.ShowProperty(ref selectedProperty, false);
            modifyDisplacement.ShowProperty(ref selectedProperty, false);
            displacementMultiplier.ShowProperty(ref selectedProperty, false);

            if (selectedProperty != previousSelection)
            {
                shouldRepaint = true;
            }
        }
//============================================================================//
        #region GUI

        // SHOW PROPERTIES //
        //
        override public void ShowProperties(ref bool shouldRepaint)
        {
            base.ShowProperties(ref shouldRepaint);
            BaseProperty previousSelection = selectedProperty;

            PropertyGroup("");

            if (orientation.displayData == null)
            {
                orientation.displayData = () => orientationDisplayData;                                              // We have to do this here because delegates are not serialized.
            }
            orientation.ShowProperty(ref selectedProperty, false);

            if (alignmentVector == null)                // HACK
            {
                alignmentVector = ScriptableObject.CreateInstance <VectorProperty>();
                alignmentVector.Initialize("Alignment vector", new Vector4(0, 1, 0, 0), ownerBlueprint);
                alignmentVector.hideW = true;
                AddProperty(alignmentVector, false);
            }
            if (orientation.GetValue() == (int)eOrientation.VectorAlignedCameraFacing)
            {
                alignmentVector.ShowProperty(ref selectedProperty, false);
            }

            if (normalMode.displayData == null)
            {
                normalMode.displayData = () => normalModeDisplayData;                                             // We have to do this here because delegates are not serialized.
            }
            normalMode.ShowProperty(ref selectedProperty, false);
            if (tangentMode.displayData == null)
            {
                tangentMode.displayData = () => tangentModeDisplayData;                                              // We have to do this here because delegates are not serialized.
            }
            tangentMode.ShowProperty(ref selectedProperty, false);
            if (uv2Mode.displayData == null)
            {
                uv2Mode.displayData = () => uv2ModeDisplayData;                                          // We have to do this here because delegates are not serialized.
            }
            uv2Mode.ShowProperty(ref selectedProperty, false);

            bool previousIsDoubleSided = isDoubleSided.GetValue();

            isDoubleSided.ShowProperty(ref selectedProperty, false);
            bool currentIsDoubleSided = isDoubleSided.GetValue();

            if (currentIsDoubleSided != previousIsDoubleSided)
            {
                ownerBlueprint.ownerEmitter.SoftReset();
            }

            if (currentIsDoubleSided)
            {
                if (doubleSidedColorMode.displayData == null)
                {
                    doubleSidedColorMode.displayData = () => doubleSidedColorModeDisplayData;                                                           // We have to do this here because delegates are not serialized.
                }
                doubleSidedColorMode.ShowProperty(ref selectedProperty, false);
            }
            if (selectedProperty != previousSelection)
            {
                shouldRepaint = true;
            }
        }
//============================================================================//
        #region GUI

        // SHOW PROPERTIES //
        //
        override public void ShowProperties(ref bool shouldRepaint)
        {
            moduleName.ShowProperty(ref selectedProperty, false);
            eventName.ShowProperty(ref selectedProperty, false);

            useCurrentStack.ShowProperty(ref selectedProperty, false);
            if (useCurrentStack.GetValue() == false)
            {
                if (property.displayData == null)
                {
                    property.displayData = () => AmpsHelpers.curveInputDisplayData;                                               // We have to do this here because delegates are not serialized.
                }
                property.ShowProperty(ref selectedProperty, false);
            }

            if ((useCurrentStack.GetValue() == false &&
                 AmpsHelpers.isFloatInput((AmpsHelpers.eCurveInputs)property.GetValue()) == false)
                ||
                (useCurrentStack.GetValue() &&
                 AmpsHelpers.isFloatStack(ownerStack.stackFunction) == false))
            {
                if (propertyVectorComponent.displayData == null)
                {
                    propertyVectorComponent.displayData = () => AmpsHelpers.vectorComponentsDisplayData;                                                              // We have to do this here because delegates are not serialized.
                }
                propertyVectorComponent.ShowProperty(ref selectedProperty, false);
            }

            if (condition.displayData == null)
            {
                condition.displayData = () => conditionsDisplayData;                                            // We have to do this here because delegates are not serialized.
            }
            condition.ShowProperty(ref selectedProperty, false);
            value.ShowProperty(ref selectedProperty, false);

            PropertyGroup("Constraints");

            maxEventCount.ShowProperty(ref selectedProperty, false);
            minEventDelay.ShowProperty(ref selectedProperty, false);

            PropertyGroup("Extra data");

            if (sentProperty1.displayData == null)
            {
                sentProperty1.displayData = () => AmpsHelpers.curveInputDisplayData;                                                // We have to do this here because delegates are not serialized.
            }
            sentProperty1.ShowProperty(ref selectedProperty, false);
            if (sentProperty2.displayData == null)
            {
                sentProperty2.displayData = () => AmpsHelpers.curveInputDisplayData;                                                // We have to do this here because delegates are not serialized.
            }
            sentProperty2.ShowProperty(ref selectedProperty, false);
            if (sentProperty3.displayData == null)
            {
                sentProperty3.displayData = () => AmpsHelpers.curveInputDisplayData;                                                // We have to do this here because delegates are not serialized.
            }
            sentProperty3.ShowProperty(ref selectedProperty, false);
            if (sentProperty4.displayData == null)
            {
                sentProperty4.displayData = () => AmpsHelpers.curveInputDisplayData;                                                // We have to do this here because delegates are not serialized.
            }
            sentProperty4.ShowProperty(ref selectedProperty, false);

            shouldRepaint = true;
        }