Esempio n. 1
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;
        }
Esempio n. 2
0
//============================================================================//
        #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;
        }