GetRenderersSerializedObject() 공개 정적인 메소드

public static GetRenderersSerializedObject ( SerializedObject serializedObject ) : SerializedObject
serializedObject UnityEditor.SerializedObject
리턴 UnityEditor.SerializedObject
예제 #1
0
        protected virtual void OnEnable()
        {
#if NEW_PREFAB_SYSTEM
            isInspectingPrefab = false;
#else
            isInspectingPrefab = (PrefabUtility.GetPrefabType(target) == PrefabType.Prefab);
#endif
            SpineEditorUtilities.ConfirmInitialization();

            // Labels
            SkeletonDataAssetLabel       = new GUIContent("SkeletonData Asset", Icons.spine);
            SkeletonUtilityButtonContent = new GUIContent("Add Skeleton Utility", Icons.skeletonUtility);
            ImmubleTrianglesLabel        = new GUIContent("Immutable Triangles", "Enable to optimize rendering for skeletons that never change attachment visbility");
            PMAVertexColorsLabel         = new GUIContent("PMA Vertex Colors", "Use this if you are using the default Spine/Skeleton shader or any premultiply-alpha shader.");
            ClearStateOnDisableLabel     = new GUIContent("Clear State On Disable", "Use this if you are pooling or enabling/disabling your Spine GameObject.");
            ZSpacingLabel             = new GUIContent("Z Spacing", "A value other than 0 adds a space between each rendered attachment to prevent Z Fighting when using shaders that read or write to the depth buffer. Large values may cause unwanted parallax and spaces depending on camera setup.");
            NormalsLabel              = new GUIContent("Add Normals", "Use this if your shader requires vertex normals. A more efficient solution for 2D setups is to modify the shader to assume a single normal value for the whole mesh.");
            TangentsLabel             = new GUIContent("Solve Tangents", "Calculates the tangents per frame. Use this if you are using lit shaders (usually with normal maps) that require vertex tangents.");
            TintBlackLabel            = new GUIContent("Tint Black (!)", "Adds black tint vertex data to the mesh as UV2 and UV3. Black tinting requires that the shader interpret UV2 and UV3 as black tint colors for this effect to work. You may also use the default [Spine/Skeleton Tint Black] shader.\n\nIf you only need to tint the whole skeleton and not individual parts, the [Spine/Skeleton Tint] shader is recommended for better efficiency and changing/animating the _Black material property via MaterialPropertyBlock.");
            SingleSubmeshLabel        = new GUIContent("Use Single Submesh", "Simplifies submesh generation by assuming you are only using one Material and need only one submesh. This is will disable multiple materials, render separation, and custom slot materials.");
            UpdateWhenInvisibleLabel  = new GUIContent("Update When Invisible", "Update mode used when the MeshRenderer becomes invisible. Update mode is automatically reset to UpdateMode.FullUpdate when the mesh becomes visible again.");
            FixDrawOrderLabel         = new GUIContent("Fix Draw Order", "Applies only when 3+ submeshes are used (2+ materials with alternating order, e.g. \"A B A\"). If true, GPU instancing will be disabled at all materials and MaterialPropertyBlocks are assigned at each material to prevent aggressive batching of submeshes by e.g. the LWRP renderer, leading to incorrect draw order (e.g. \"A1 B A2\" changed to \"A1A2 B\"). You can disable this parameter when everything is drawn correctly to save the additional performance cost. Note: the GPU instancing setting will remain disabled at affected material assets after exiting play mode, you have to enable it manually if you accidentally enabled this parameter.");
            MaskInteractionLabel      = new GUIContent("Mask Interaction", "SkeletonRenderer's interaction with a Sprite Mask.");
            MaskMaterialsHeadingLabel = new GUIContent("Mask Interaction Materials", "Materials used for different interaction with sprite masks.");
            MaskMaterialsNoneLabel    = new GUIContent("Normal Materials", "Normal materials used when Mask Interaction is set to None.");
            MaskMaterialsInsideLabel  = new GUIContent("Inside Mask", "Materials used when Mask Interaction is set to Inside Mask.");
            MaskMaterialsOutsideLabel = new GUIContent("Outside Mask", "Materials used when Mask Interaction is set to Outside Mask.");
            SetMaterialButtonLabel    = new GUIContent("Set", "Prepares material references for switching to the corresponding Mask Interaction mode at runtime. Creates the required materials if they do not exist.");
            ClearMaterialButtonLabel  = new GUIContent("Clear", "Clears unused material references. Note: when switching to the corresponding Mask Interaction mode at runtime, a new material is generated on the fly.");
            DeleteMaterialButtonLabel = new GUIContent("Delete", "Clears unused material references and deletes the corresponding assets. Note: when switching to the corresponding Mask Interaction mode at runtime, a new material is generated on the fly.");

            var so = this.serializedObject;
            skeletonDataAsset    = so.FindProperty("skeletonDataAsset");
            initialSkinName      = so.FindProperty("initialSkinName");
            initialFlipX         = so.FindProperty("initialFlipX");
            initialFlipY         = so.FindProperty("initialFlipY");
            normals              = so.FindProperty("addNormals");
            tangents             = so.FindProperty("calculateTangents");
            immutableTriangles   = so.FindProperty("immutableTriangles");
            pmaVertexColors      = so.FindProperty("pmaVertexColors");
            clearStateOnDisable  = so.FindProperty("clearStateOnDisable");
            tintBlack            = so.FindProperty("tintBlack");
            updateWhenInvisible  = so.FindProperty("updateWhenInvisible");
            singleSubmesh        = so.FindProperty("singleSubmesh");
            fixDrawOrder         = so.FindProperty("fixDrawOrder");
            maskInteraction      = so.FindProperty("maskInteraction");
            maskMaterialsNone    = so.FindProperty("maskMaterials.materialsMaskDisabled");
            maskMaterialsInside  = so.FindProperty("maskMaterials.materialsInsideMask");
            maskMaterialsOutside = so.FindProperty("maskMaterials.materialsOutsideMask");

            separatorSlotNames            = so.FindProperty("separatorSlotNames");
            separatorSlotNames.isExpanded = true;

            zSpacing = so.FindProperty("zSpacing");

            SerializedObject renderersSerializedObject = SpineInspectorUtility.GetRenderersSerializedObject(serializedObject);             // Allows proper multi-edit behavior.
            sortingProperties = new SpineInspectorUtility.SerializedSortingProperties(renderersSerializedObject);
        }
        protected virtual void OnEnable()
        {
            isInspectingPrefab = (PrefabUtility.GetPrefabType(target) == PrefabType.Prefab);

            SpineEditorUtilities.ConfirmInitialization();

            // Labels
            SkeletonDataAssetLabel       = new GUIContent("SkeletonData Asset", Icons.spine);
            SkeletonUtilityButtonContent = new GUIContent("Add Skeleton Utility", Icons.skeletonUtility);
            MeshesLabel              = new GUIContent("Render MeshAttachments", "Disable to optimize rendering for skeletons that don't use Mesh Attachments");
            ImmubleTrianglesLabel    = new GUIContent("Immutable Triangles", "Enable to optimize rendering for skeletons that never change attachment visbility");
            PMAVertexColorsLabel     = new GUIContent("PMA Vertex Colors", "Use this if you are using the default Spine/Skeleton shader or any premultiply-alpha shader.");
            ClearStateOnDisableLabel = new GUIContent("Clear State On Disable", "Use this if you are pooling or enabling/disabling your Spine GameObject.");
            ZSpacingLabel            = new GUIContent("Z Spacing", "A value other than 0 adds a space between each rendered attachment to prevent Z Fighting when using shaders that read or write to the depth buffer. Large values may cause unwanted parallax and spaces depending on camera setup.");
            NormalsLabel             = new GUIContent("Add Normals", "Use this if your shader requires vertex normals. A more efficient solution for 2D setups is to modify the shader to assume a single normal value for the whole mesh.");
            TangentsLabel            = new GUIContent("Solve Tangents", "Calculates the tangents per frame. Use this if you are using lit shaders (usually with normal maps) that require vertex tangents.");
            TintBlackLabel           = new GUIContent("Tint Black (!)", "Adds black tint vertex data to the mesh as UV2 and UV3. Black tinting requires that the shader interpret UV2 and UV3 as black tint colors for this effect to work. You may also use the default [Spine/Skeleton Tint Black] shader.\n\nIf you only need to tint the whole skeleton and not individual parts, the [Spine/Skeleton Tint] shader is recommended for better efficiency and changing/animating the _Black material property via MaterialPropertyBlock.");
            SingleSubmeshLabel       = new GUIContent("Use Single Submesh", "Simplifies submesh determination by assuming you are only using one Material and need only one submesh. This is will disable render separation and custom slot materials.");

            var so = this.serializedObject;

            skeletonDataAsset   = so.FindProperty("skeletonDataAsset");
            initialSkinName     = so.FindProperty("initialSkinName");
            initialFlipX        = so.FindProperty("initialFlipX");
            initialFlipY        = so.FindProperty("initialFlipY");
            normals             = so.FindProperty("addNormals");
            tangents            = so.FindProperty("calculateTangents");
            meshes              = so.FindProperty("renderMeshes");
            immutableTriangles  = so.FindProperty("immutableTriangles");
            pmaVertexColors     = so.FindProperty("pmaVertexColors");
            clearStateOnDisable = so.FindProperty("clearStateOnDisable");
            tintBlack           = so.FindProperty("tintBlack");
            singleSubmesh       = so.FindProperty("singleSubmesh");

            separatorSlotNames            = so.FindProperty("separatorSlotNames");
            separatorSlotNames.isExpanded = true;

            zSpacing = so.FindProperty("zSpacing");

            SerializedObject rso = SpineInspectorUtility.GetRenderersSerializedObject(serializedObject);

            sortingProperties = new SpineInspectorUtility.SerializedSortingProperties(rso);
        }
        protected virtual void OnEnable()
        {
            isInspectingPrefab = (PrefabUtility.GetPrefabType(target) == PrefabType.Prefab);

            SpineEditorUtilities.ConfirmInitialization();
            skeletonDataAsset             = serializedObject.FindProperty("skeletonDataAsset");
            initialSkinName               = serializedObject.FindProperty("initialSkinName");
            normals                       = serializedObject.FindProperty("calculateNormals");
            tangents                      = serializedObject.FindProperty("calculateTangents");
            meshes                        = serializedObject.FindProperty("renderMeshes");
            immutableTriangles            = serializedObject.FindProperty("immutableTriangles");
            pmaVertexColors               = serializedObject.FindProperty("pmaVertexColors");
            separatorSlotNames            = serializedObject.FindProperty("separatorSlotNames");
            separatorSlotNames.isExpanded = true;

            frontFacing = serializedObject.FindProperty("frontFacing");
            zSpacing    = serializedObject.FindProperty("zSpacing");

            SerializedObject rso = SpineInspectorUtility.GetRenderersSerializedObject(serializedObject);

            sortingProperties = new SpineInspectorUtility.SerializedSortingProperties(rso);
        }
        protected virtual void OnEnable()
        {
            isInspectingPrefab = (PrefabUtility.GetPrefabType(target) == PrefabType.Prefab);

            SpineEditorUtilities.ConfirmInitialization();

            // Labels
            SkeletonDataAssetLabel       = new GUIContent("SkeletonData Asset", SpineEditorUtilities.Icons.spine);
            SkeletonUtilityButtonContent = new GUIContent("Add Skeleton Utility", SpineEditorUtilities.Icons.skeletonUtility);
            MeshesLabel              = new GUIContent("Render MeshAttachments", "Disable to optimize rendering for skeletons that don't use Mesh Attachments");
            ImmubleTrianglesLabel    = new GUIContent("Immutable Triangles", "Enable to optimize rendering for skeletons that never change attachment visbility");
            PMAVertexColorsLabel     = new GUIContent("PMA Vertex Colors", "Use this if you are using the default Spine/Skeleton shader or any premultiply-alpha shader.");
            ClearStateOnDisableLabel = new GUIContent("Clear State On Disable", "Use this if you are pooling or enabling/disabling your Spine GameObject.");
            ZSpacingLabel            = new GUIContent("Z Spacing", "A value other than 0 adds a space between each rendered attachment to prevent Z Fighting when using shaders that read or write to the depth buffer. Large values may cause unwanted parallax and spaces depending on camera setup.");
            NormalsLabel             = new GUIContent("Add Normals", "Use this if your shader requires vertex normals. A more efficient solution for 2D setups is to modify the shader to assume a single normal value for the whole mesh.");
            TangentsLabel            = new GUIContent("Solve Tangents", "Calculates the tangents per frame. Use this if you are using lit shaders (usually with normal maps) that require vertex tangents.");

            var so = this.serializedObject;

            skeletonDataAsset   = so.FindProperty("skeletonDataAsset");
            initialSkinName     = so.FindProperty("initialSkinName");
            normals             = so.FindProperty("calculateNormals");
            tangents            = so.FindProperty("calculateTangents");
            meshes              = so.FindProperty("renderMeshes");
            immutableTriangles  = so.FindProperty("immutableTriangles");
            pmaVertexColors     = so.FindProperty("pmaVertexColors");
            clearStateOnDisable = so.FindProperty("clearStateOnDisable");

            separatorSlotNames            = so.FindProperty("separatorSlotNames");
            separatorSlotNames.isExpanded = true;

            frontFacing = so.FindProperty("frontFacing");
            zSpacing    = so.FindProperty("zSpacing");

            SerializedObject rso = SpineInspectorUtility.GetRenderersSerializedObject(serializedObject);

            sortingProperties = new SpineInspectorUtility.SerializedSortingProperties(rso);
        }