//============================================================================//
#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);
        }
Beispiel #2
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;
        }
//============================================================================//
#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);
        }
Beispiel #5
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);

            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);
        }
//============================================================================//
#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.
        }