//============================================================================// #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; } }
//============================================================================// #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); } }
//============================================================================// #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; } }
//// 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; }
//// COPY PROPERTIES // //// //override public void CopyProperties(BaseModule originalModule, AmpsBlueprint theOwnerBlueprint) //{ // base.CopyProperties(originalModule, theOwnerBlueprint); // DataConverterModule om = originalModule as DataConverterModule; // if (om != null) // { // conversionMode.CopyProperty(om.conversionMode, theOwnerBlueprint); // } //} //// REFERENCE PROPERTIES // //// //override public void ReferenceProperties(BaseModule originalModule) //{ // base.ReferenceProperties(originalModule); // DataConverterModule om = originalModule as DataConverterModule; // ReferenceAProperty(conversionMode, om, om.conversionMode); //} //============================================================================// #region GUI // SHOW PROPERTIES // // override public void ShowProperties(ref bool shouldRepaint) { //base.ShowProperties(ref shouldRepaint); BaseProperty previousSelection = selectedProperty; moduleName.ShowProperty(ref selectedProperty, false); PropertyGroup(""); if (conversionMode.displayData == null) { conversionMode.displayData = () => conversionModeDisplayData; // We have to do this here because delegates are not serialized. } conversionMode.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("Object transform"); sampledObject.ShowProperty(ref selectedProperty, false); if (sampledTransformElement.displayData == null) { sampledTransformElement.displayData = () => transformElementsDisplayData; // We have to do this here because delegates are not serialized. } sampledTransformElement.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(""); 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; } }
//============================================================================// #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; }