//============================================================================// #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; } }
//============================================================================// #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); 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); } }
//============================================================================// #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; }
//// COPY PROPERTIES // //// //override public void CopyProperties(BaseModule originalModule, AmpsBlueprint theOwnerBlueprint) //{ // base.CopyProperties(originalModule, theOwnerBlueprint); // QuickSetupMFModule om = originalModule as QuickSetupMFModule; // if (om != null) // { // spawnRate.CopyProperty(om.spawnRate, theOwnerBlueprint); // deathCondition.CopyProperty(om.deathCondition, theOwnerBlueprint); // acceleration.CopyProperty(om.acceleration, theOwnerBlueprint); // velocity.CopyProperty(om.velocity, theOwnerBlueprint); // position.CopyProperty(om.position, theOwnerBlueprint); // rotationRate.CopyProperty(om.rotationRate, theOwnerBlueprint); // rotation.CopyProperty(om.rotation, theOwnerBlueprint); // scale.CopyProperty(om.scale, theOwnerBlueprint); // color.CopyProperty(om.color, theOwnerBlueprint); // pivotOffset.CopyProperty(om.pivotOffset, theOwnerBlueprint); // } //} //============================================================================// #region GUI // SHOW PROPERTIES // // override public void ShowProperties(ref bool shouldRepaint) { base.ShowProperties(ref shouldRepaint); BaseProperty previousSelection = selectedProperty; PropertyGroup("Spawn rate"); modifySpawnRate.ShowProperty(ref selectedProperty, false); spawnRate.ShowProperty(ref selectedProperty, false); PropertyGroup("Life"); modifyDeathCondition.ShowProperty(ref selectedProperty, false); deathCondition.ShowProperty(ref selectedProperty, false); PropertyGroup("Position"); modifyPosition.ShowProperty(ref selectedProperty, false); position.ShowProperty(ref selectedProperty, false); PropertyGroup("Acceleration"); modifyAcceleration.ShowProperty(ref selectedProperty, false); acceleration.ShowProperty(ref selectedProperty, false); PropertyGroup("Velocity"); modifyVelocity.ShowProperty(ref selectedProperty, false); velocity.ShowProperty(ref selectedProperty, false); PropertyGroup("Rotation"); modifyRotation.ShowProperty(ref selectedProperty, false); rotation.ShowProperty(ref selectedProperty, false); PropertyGroup("Rotation rate"); modifyRotationRate.ShowProperty(ref selectedProperty, false); rotationRate.ShowProperty(ref selectedProperty, false); PropertyGroup("Scale"); modifyScale.ShowProperty(ref selectedProperty, false); scale.ShowProperty(ref selectedProperty, false); PropertyGroup("Color"); modifyColor.ShowProperty(ref selectedProperty, false); color.ShowProperty(ref selectedProperty, false); PropertyGroup("Pivot offset"); modifyPivotOffset.ShowProperty(ref selectedProperty, false); pivotOffset.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(""); value.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(""); 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; if (ownerStack.stackFunction != AmpsHelpers.eStackFunction.Shared) { weight.ShowProperty(ref selectedProperty, false); if (blendMode.displayData == null) { blendMode.displayData = () => blendModesDisplayData; // We have to do this here because delegates are not serialized. } blendMode.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(""); inputMeshCount.constant = inputMeshes.Length; inputMeshCount.ShowProperty(ref selectedProperty, false); if (inputMeshCount.GetValue() > 0 && inputMeshCount.GetValue() != inputMeshes.Length) { MeshProperty[] newMeshes = new MeshProperty[(int)inputMeshCount.GetValue()]; for (int i = 0; i < newMeshes.Length; i++) { if (i <= inputMeshes.Length - 1) { newMeshes[i] = inputMeshes[i]; } else { newMeshes[i] = ScriptableObject.CreateInstance <MeshProperty>(); newMeshes[i].Initialize("Mesh " + i); AddProperty(newMeshes[i], false); } } inputMeshes = newMeshes; } foreach (MeshProperty m in inputMeshes) { m.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; }