Anima2D.SpriteMeshCache.CreateBlendshape C# (CSharp) Method

CreateBlendshape() public method

public CreateBlendshape ( string name, string undoName = "" ) : BlendShape
name string
undoName string
return BlendShape
		public BlendShape CreateBlendshape(string name, string undoName = "")
		{
			BlendShape blendShape = BlendShape.Create(name);
			blendShape.hideFlags = HideFlags.DontSave;

			RegisterUndo(undoName);

			RegisterCreatedObjectUndo(blendShape, undoName);

			blendshapes.Add(blendShape);

			m_DirtyVertices = true;

			return blendShape;
		}

Usage Example

Beispiel #1
0
        void CreateBlendshape()
        {
            if (spriteMeshCache)
            {
                BlendShape blendShape = spriteMeshCache.CreateBlendshape("New BlendShape", "Create BlendShape");

                spriteMeshCache.selectedBlendshape = blendShape;

                spriteMeshCache.CreateBlendShapeFrame(blendShape, 100f, "Create BlendShape");

                spriteMeshCache.blendShapeWeight = 100f;
            }
        }