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